Advertisement
parishan

time

Mar 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.62 KB | None | 0 0
  1.  
  2. Help on built-in module time:
  3.  
  4. NAME
  5. time - This module provides various functions to manipulate time values.
  6.  
  7. FILE
  8. (built-in)
  9.  
  10. DESCRIPTION
  11. There are two standard representations of time. One is the number
  12. of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer
  13. or a floating point number (to represent fractions of seconds).
  14. The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
  15. The actual value can be retrieved by calling gmtime(0).
  16.  
  17. The other representation is a tuple of 9 integers giving local time.
  18. The tuple items are:
  19. year (four digits, e.g. 1998)
  20. month (1-12)
  21. day (1-31)
  22. hours (0-23)
  23. minutes (0-59)
  24. seconds (0-59)
  25. weekday (0-6, Monday is 0)
  26. Julian day (day in the year, 1-366)
  27. DST (Daylight Savings Time) flag (-1, 0 or 1)
  28. If the DST flag is 0, the time is given in the regular time zone;
  29. if it is 1, the time is given in the DST time zone;
  30. if it is -1, mktime() should guess based on the date and time.
  31.  
  32. Variables:
  33.  
  34. timezone -- difference in seconds between UTC and local standard time
  35. altzone -- difference in seconds between UTC and local DST time
  36. daylight -- whether local time should reflect DST
  37. tzname -- tuple of (standard time zone name, DST time zone name)
  38.  
  39. Functions:
  40.  
  41. time() -- return current time in seconds since the Epoch as a float
  42. clock() -- return CPU time since process start as a float
  43. sleep() -- delay for a number of seconds given as a float
  44. gmtime() -- convert seconds since Epoch to UTC tuple
  45. localtime() -- convert seconds since Epoch to local time tuple
  46. asctime() -- convert time tuple to string
  47. ctime() -- convert time in seconds to string
  48. mktime() -- convert local time tuple to seconds since Epoch
  49. strftime() -- convert time tuple to string according to format specification
  50. strptime() -- parse string to time tuple according to format specification
  51. tzset() -- change the local timezone
  52.  
  53. CLASSES
  54. __builtin__.object
  55. struct_time
  56.  
  57. class struct_time(__builtin__.object)
  58. | The time value as returned by gmtime(), localtime(), and strptime(), and
  59. | accepted by asctime(), mktime() and strftime(). May be considered as a
  60. | sequence of 9 integers.
  61. |
  62. | Note that several fields' values are not the same as those defined by
  63. | the C language standard for struct tm. For example, the value of the
  64. | field tm_year is the actual year, not year - 1900. See individual
  65. | fields' descriptions for details.
  66. |
  67. | Methods defined here:
  68. |
  69. | __add__(...)
  70. | x.__add__(y) <==> x+y
  71. |
  72. | __contains__(...)
  73. | x.__contains__(y) <==> y in x
  74. |
  75. | __eq__(...)
  76. | x.__eq__(y) <==> x==y
  77. |
  78. | __ge__(...)
  79. | x.__ge__(y) <==> x>=y
  80. |
  81. | __getitem__(...)
  82. | x.__getitem__(y) <==> x[y]
  83. |
  84. | __getslice__(...)
  85. | x.__getslice__(i, j) <==> x[i:j]
  86. |
  87. | Use of negative indices is not supported.
  88. |
  89. | __gt__(...)
  90. | x.__gt__(y) <==> x>y
  91. |
  92. | __hash__(...)
  93. | x.__hash__() <==> hash(x)
  94. |
  95. | __le__(...)
  96. | x.__le__(y) <==> x<=y
  97. |
  98. | __len__(...)
  99. | x.__len__() <==> len(x)
  100. |
  101. | __lt__(...)
  102. | x.__lt__(y) <==> x<y
  103. |
  104. | __mul__(...)
  105. | x.__mul__(n) <==> x*n
  106. |
  107. | __ne__(...)
  108. | x.__ne__(y) <==> x!=y
  109. |
  110. | __reduce__(...)
  111. |
  112. | __repr__(...)
  113. | x.__repr__() <==> repr(x)
  114. |
  115. | __rmul__(...)
  116. | x.__rmul__(n) <==> n*x
  117. |
  118. | ----------------------------------------------------------------------
  119. | Data descriptors defined here:
  120. |
  121. | tm_hour
  122. | hours, range [0, 23]
  123. |
  124. | tm_isdst
  125. | 1 if summer time is in effect, 0 if not, and -1 if unknown
  126. |
  127. | tm_mday
  128. | day of month, range [1, 31]
  129. |
  130. | tm_min
  131. | minutes, range [0, 59]
  132. |
  133. | tm_mon
  134. | month of year, range [1, 12]
  135. |
  136. | tm_sec
  137. | seconds, range [0, 61])
  138. |
  139. | tm_wday
  140. | day of week, range [0, 6], Monday is 0
  141. |
  142. | tm_yday
  143. | day of year, range [1, 366]
  144. |
  145. | tm_year
  146. | year, for example, 1993
  147. |
  148. | ----------------------------------------------------------------------
  149. | Data and other attributes defined here:
  150. |
  151. | __new__ = <built-in method __new__ of type object>
  152. | T.__new__(S, ...) -> a new object with type S, a subtype of T
  153. |
  154. | n_fields = 9
  155. |
  156. | n_sequence_fields = 9
  157. |
  158. | n_unnamed_fields = 0
  159.  
  160. FUNCTIONS
  161. asctime(...)
  162. asctime([tuple]) -> string
  163.  
  164. Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
  165. When the time tuple is not present, current time as returned by localtime()
  166. is used.
  167.  
  168. clock(...)
  169. clock() -> floating point number
  170.  
  171. Return the CPU time or real time since the start of the process or since
  172. the first call to clock(). This has as much precision as the system
  173. records.
  174.  
  175. ctime(...)
  176. ctime(seconds) -> string
  177.  
  178. Convert a time in seconds since the Epoch to a string in local time.
  179. This is equivalent to asctime(localtime(seconds)). When the time tuple is
  180. not present, current time as returned by localtime() is used.
  181.  
  182. gmtime(...)
  183. gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
  184. tm_sec, tm_wday, tm_yday, tm_isdst)
  185.  
  186. Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
  187. GMT). When 'seconds' is not passed in, convert the current time instead.
  188.  
  189. localtime(...)
  190. localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
  191. tm_sec,tm_wday,tm_yday,tm_isdst)
  192.  
  193. Convert seconds since the Epoch to a time tuple expressing local time.
  194. When 'seconds' is not passed in, convert the current time instead.
  195.  
  196. mktime(...)
  197. mktime(tuple) -> floating point number
  198.  
  199. Convert a time tuple in local time to seconds since the Epoch.
  200.  
  201. sleep(...)
  202. sleep(seconds)
  203.  
  204. Delay execution for a given number of seconds. The argument may be
  205. a floating point number for subsecond precision.
  206.  
  207. strftime(...)
  208. strftime(format[, tuple]) -> string
  209.  
  210. Convert a time tuple to a string according to a format specification.
  211. See the library reference manual for formatting codes. When the time tuple
  212. is not present, current time as returned by localtime() is used.
  213.  
  214. strptime(...)
  215. strptime(string, format) -> struct_time
  216.  
  217. Parse a string to a time tuple according to a format specification.
  218. See the library reference manual for formatting codes (same as strftime()).
  219.  
  220. time(...)
  221. time() -> floating point number
  222.  
  223. Return the current time in seconds since the Epoch.
  224. Fractions of a second may be present if the system clock provides them.
  225.  
  226. DATA
  227. accept2dyear = 1
  228. altzone = -16200
  229. daylight = 1
  230. timezone = -12600
  231. tzname = ('Iran Standard Time', 'Iran Daylight Time')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement