Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start_time = 1234566
- end_time = 1234578
- >>> import time
- >>> time.gmtime(123456)
- time.struct_time(tm_year=1970, tm_mon=1, tm_mday=2, tm_hour=10, tm_min=17, tm_sec=36, tm_wday=4, tm_yday=2, tm_isdst=0)
- 2012-09-12 21:00:00
- `TypeError: a float is required`
- mend = time.gmtime(getbbb_class.end_time).tm_hour
- time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(1347517370))
- In [1]: time.time()
- Out[1]: 1347517739.44904
- In [2]: time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()))
- Out[2]: '2012-09-13 06:31:43'
- >>> import time
- >>> time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(1347517119))
- '2012-09-12 23:18:39'
- INSERT INTO tblname VALUES (FROM_UNIXTIME(1347517119))
- The ctime(), gmtime() and localtime() functions all take an argument of data type time_t which represents calendar time. When inter-
- preted as an absolute time value, it represents the number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal
- Time (UTC).
- >>> time.time()
- 1347517171.6514659
- >>> time.gmtime(time.time())
- (2012, 9, 13, 6, 19, 34, 3, 257, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement