-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime.py
31 lines (22 loc) · 1 KB
/
time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import time, datetime
time_str = datetime.date(2012,1,1,)
time_tuple = time.gmtime()
time_seconds = time.mktime(time_tuple)
time_seconds = os.path.getmtime(fn)
week_number = int(time.strftime('%U',time_tuple,))
time_tuple = time.strptime("%s %s %s" %(year,month,day,), "%Y %m %d")
time_tuple = time.localtime(time_seconds)
time_str = time_str-datetime.timedelta(days=int(42))
'''
time() -- return current time in seconds since the Epoch as a float
clock() -- return CPU time since process start as a float
sleep() -- delay for a number of seconds given as a float
gmtime() -- convert seconds since Epoch to UTC tuple
localtime() -- convert seconds since Epoch to local time tuple
asctime() -- convert time tuple to string
ctime() -- convert time in seconds to string
mktime() -- convert local time tuple to seconds since Epoch
strftime() -- convert time tuple to string according to format specification
strptime() -- parse string to time tuple according to format specification
tzset() -- change the local timezone
'''