lmgsanm

每天学习一点,每天进步一点点…… Tomorrow is another beatifull day

导航

python模块:time

  1 # encoding: utf-8
  2 # module time
  3 # from (built-in)
  4 # by generator 1.145
  5 """
  6 This module provides various functions to manipulate time values.
  7 
  8 There are two standard representations of time.  One is the number
  9 of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer
 10 or a floating point number (to represent fractions of seconds).
 11 The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
 12 The actual value can be retrieved by calling gmtime(0).
 13 
 14 The other representation is a tuple of 9 integers giving local time.
 15 The tuple items are:
 16   year (including century, e.g. 1998)
 17   month (1-12)
 18   day (1-31)
 19   hours (0-23)
 20   minutes (0-59)
 21   seconds (0-59)
 22   weekday (0-6, Monday is 0)
 23   Julian day (day in the year, 1-366)
 24   DST (Daylight Savings Time) flag (-1, 0 or 1)
 25 If the DST flag is 0, the time is given in the regular time zone;
 26 if it is 1, the time is given in the DST time zone;
 27 if it is -1, mktime() should guess based on the date and time.
 28 
 29 Variables:
 30 
 31 timezone -- difference in seconds between UTC and local standard time
 32 altzone -- difference in  seconds between UTC and local DST time
 33 daylight -- whether local time should reflect DST
 34 tzname -- tuple of (standard time zone name, DST time zone name)
 35 
 36 Functions:
 37 
 38 time() -- return current time in seconds since the Epoch as a float
 39 clock() -- return CPU time since process start as a float
 40 sleep() -- delay for a number of seconds given as a float
 41 gmtime() -- convert seconds since Epoch to UTC tuple
 42 localtime() -- convert seconds since Epoch to local time tuple
 43 asctime() -- convert time tuple to string
 44 ctime() -- convert time in seconds to string
 45 mktime() -- convert local time tuple to seconds since Epoch
 46 strftime() -- convert time tuple to string according to format specification
 47 strptime() -- parse string to time tuple according to format specification
 48 tzset() -- change the local timezone
 49 """
 50 # no imports
 51 
 52 # Variables with simple values
 53 
 54 altzone = -32400
 55 
 56 daylight = 0
 57 
 58 timezone = -28800
 59 
 60 _STRUCT_TM_ITEMS = 11
 61 
 62 # functions
 63 
 64 def asctime(p_tuple=None): # real signature unknown; restored from __doc__
 65     """
 66     asctime([tuple]) -> string
 67     
 68     Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
 69     When the time tuple is not present, current time as returned by localtime()
 70     is used.
 71     """
 72     return ""
 73 
 74 def clock(): # real signature unknown; restored from __doc__
 75     """
 76     clock() -> floating point number
 77     
 78     Return the CPU time or real time since the start of the process or since
 79     the first call to clock().  This has as much precision as the system
 80     records.
 81     """
 82     return 0.0
 83 
 84 def ctime(seconds=None): # known case of time.ctime
 85     """
 86     ctime(seconds) -> string
 87     
 88     Convert a time in seconds since the Epoch to a string in local time.
 89     This is equivalent to asctime(localtime(seconds)). When the time tuple is
 90     not present, current time as returned by localtime() is used.
 91     """
 92     return ""
 93 
 94 def get_clock_info(name): # real signature unknown; restored from __doc__
 95     """
 96     get_clock_info(name: str) -> dict
 97     
 98     Get information of the specified clock.
 99     """
100     return {}
101 
102 def gmtime(seconds=None): # real signature unknown; restored from __doc__
103     """
104     gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
105                            tm_sec, tm_wday, tm_yday, tm_isdst)
106     
107     Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
108     GMT).  When 'seconds' is not passed in, convert the current time instead.
109     
110     If the platform supports the tm_gmtoff and tm_zone, they are available as
111     attributes only.
112     """
113     pass
114 
115 def localtime(seconds=None): # real signature unknown; restored from __doc__
116     """
117     localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
118                               tm_sec,tm_wday,tm_yday,tm_isdst)
119     
120     Convert seconds since the Epoch to a time tuple expressing local time.
121     When 'seconds' is not passed in, convert the current time instead.
122     """
123     pass
124 
125 def mktime(p_tuple): # real signature unknown; restored from __doc__
126     """
127     mktime(tuple) -> floating point number
128     
129     Convert a time tuple in local time to seconds since the Epoch.
130     Note that mktime(gmtime(0)) will not generally return zero for most
131     time zones; instead the returned value will either be equal to that
132     of the timezone or altzone attributes on the time module.
133     """
134     return 0.0
135 
136 def monotonic(): # real signature unknown; restored from __doc__
137     """
138     monotonic() -> float
139     
140     Monotonic clock, cannot go backward.
141     """
142     return 0.0
143 
144 def perf_counter(): # real signature unknown; restored from __doc__
145     """
146     perf_counter() -> float
147     
148     Performance counter for benchmarking.
149     """
150     return 0.0
151 
152 def process_time(): # real signature unknown; restored from __doc__
153     """
154     process_time() -> float
155     
156     Process time for profiling: sum of the kernel and user-space CPU time.
157     """
158     return 0.0
159 
160 def sleep(seconds): # real signature unknown; restored from __doc__
161     """
162     sleep(seconds)
163     
164     Delay execution for a given number of seconds.  The argument may be
165     a floating point number for subsecond precision.
166     """
167     pass
168 
169 def strftime(format, p_tuple=None): # real signature unknown; restored from __doc__
170     """
171     strftime(format[, tuple]) -> string
172     
173     Convert a time tuple to a string according to a format specification.
174     See the library reference manual for formatting codes. When the time tuple
175     is not present, current time as returned by localtime() is used.
176     
177     Commonly used format codes:
178     
179     %Y  Year with century as a decimal number.
180     %m  Month as a decimal number [01,12].
181     %d  Day of the month as a decimal number [01,31].
182     %H  Hour (24-hour clock) as a decimal number [00,23].
183     %M  Minute as a decimal number [00,59].
184     %S  Second as a decimal number [00,61].
185     %z  Time zone offset from UTC.
186     %a  Locale's abbreviated weekday name.
187     %A  Locale's full weekday name.
188     %b  Locale's abbreviated month name.
189     %B  Locale's full month name.
190     %c  Locale's appropriate date and time representation.
191     %I  Hour (12-hour clock) as a decimal number [01,12].
192     %p  Locale's equivalent of either AM or PM.
193     
194     Other codes may be available on your platform.  See documentation for
195     the C library strftime function.
196     """
197     return ""
198 
199 def strptime(string, format): # real signature unknown; restored from __doc__
200     """
201     strptime(string, format) -> struct_time
202     
203     Parse a string to a time tuple according to a format specification.
204     See the library reference manual for formatting codes (same as
205     strftime()).
206     
207     Commonly used format codes:
208     
209     %Y  Year with century as a decimal number.
210     %m  Month as a decimal number [01,12].
211     %d  Day of the month as a decimal number [01,31].
212     %H  Hour (24-hour clock) as a decimal number [00,23].
213     %M  Minute as a decimal number [00,59].
214     %S  Second as a decimal number [00,61].
215     %z  Time zone offset from UTC.
216     %a  Locale's abbreviated weekday name.
217     %A  Locale's full weekday name.
218     %b  Locale's abbreviated month name.
219     %B  Locale's full month name.
220     %c  Locale's appropriate date and time representation.
221     %I  Hour (12-hour clock) as a decimal number [01,12].
222     %p  Locale's equivalent of either AM or PM.
223     
224     Other codes may be available on your platform.  See documentation for
225     the C library strftime function.
226     """
227     return struct_time
228 
229 def time(): # real signature unknown; restored from __doc__
230     """
231     time() -> floating point number
232     
233     Return the current time in seconds since the Epoch.
234     Fractions of a second may be present if the system clock provides them.
235     """
236     return 0.0
237 
238 # classes
239 
240 class struct_time(tuple):
241     """
242     The time value as returned by gmtime(), localtime(), and strptime(), and
243      accepted by asctime(), mktime() and strftime().  May be considered as a
244      sequence of 9 integers.
245     
246      Note that several fields' values are not the same as those defined by
247      the C language standard for struct tm.  For example, the value of the
248      field tm_year is the actual year, not year - 1900.  See individual
249      fields' descriptions for details.
250     """
251     def __init__(self, *args, **kwargs): # real signature unknown
252         pass
253 
254     @staticmethod # known case of __new__
255     def __new__(*args, **kwargs): # real signature unknown
256         """ Create and return a new object.  See help(type) for accurate signature. """
257         pass
258 
259     def __reduce__(self, *args, **kwargs): # real signature unknown
260         pass
261 
262     def __repr__(self, *args, **kwargs): # real signature unknown
263         """ Return repr(self). """
264         pass
265 
266     tm_gmtoff = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
267     """offset from UTC in seconds"""
268 
269     tm_hour = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
270     """hours, range [0, 23]"""
271 
272     tm_isdst = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
273     """1 if summer time is in effect, 0 if not, and -1 if unknown"""
274 
275     tm_mday = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
276     """day of month, range [1, 31]"""
277 
278     tm_min = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
279     """minutes, range [0, 59]"""
280 
281     tm_mon = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
282     """month of year, range [1, 12]"""
283 
284     tm_sec = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
285     """seconds, range [0, 61])"""
286 
287     tm_wday = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
288     """day of week, range [0, 6], Monday is 0"""
289 
290     tm_yday = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
291     """day of year, range [1, 366]"""
292 
293     tm_year = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
294     """year, for example, 1993"""
295 
296     tm_zone = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
297     """abbreviation of timezone name"""
298 
299 
300     n_fields = 11
301     n_sequence_fields = 9
302     n_unnamed_fields = 0
303 
304 
305 class __loader__(object):
306     """
307     Meta path import for built-in modules.
308     
309         All methods are either class or static methods to avoid the need to
310         instantiate the class.
311     """
312     @classmethod
313     def create_module(cls, *args, **kwargs): # real signature unknown
314         """ Create a built-in module """
315         pass
316 
317     @classmethod
318     def exec_module(cls, *args, **kwargs): # real signature unknown
319         """ Exec a built-in module """
320         pass
321 
322     @classmethod
323     def find_module(cls, *args, **kwargs): # real signature unknown
324         """
325         Find the built-in module.
326         
327                 If 'path' is ever specified then the search is considered a failure.
328         
329                 This method is deprecated.  Use find_spec() instead.
330         """
331         pass
332 
333     @classmethod
334     def find_spec(cls, *args, **kwargs): # real signature unknown
335         pass
336 
337     @classmethod
338     def get_code(cls, *args, **kwargs): # real signature unknown
339         """ Return None as built-in modules do not have code objects. """
340         pass
341 
342     @classmethod
343     def get_source(cls, *args, **kwargs): # real signature unknown
344         """ Return None as built-in modules do not have source code. """
345         pass
346 
347     @classmethod
348     def is_package(cls, *args, **kwargs): # real signature unknown
349         """ Return False as built-in modules are never packages. """
350         pass
351 
352     @classmethod
353     def load_module(cls, *args, **kwargs): # real signature unknown
354         """
355         Load the specified module into sys.modules and return it.
356         
357             This method is deprecated.  Use loader.exec_module instead.
358         """
359         pass
360 
361     def module_repr(module): # reliably restored by inspect
362         """
363         Return repr for the module.
364         
365                 The method is deprecated.  The import machinery does the job itself.
366         """
367         pass
368 
369     def __init__(self, *args, **kwargs): # real signature unknown
370         pass
371 
372     __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
373     """list of weak references to the object (if defined)"""
374 
375 
376     __dict__ = None # (!) real value is ''
377 
378 
379 # variables with complex values
380 
381 tzname = (
382     'China Standard Time',
383     'China Daylight Time',
384 )
385 
386 __spec__ = None # (!) real value is ''
python:time

 

posted on 2018-01-29 22:17  lmgsanm  阅读(327)  评论(0编辑  收藏  举报