2014-01-27 116 views

回答

1

可以使用datetime模塊來獲取當前本地時間,然後convert that to a UNIX timestamp

import datetime 
import calendar 

now = calendar.timegm(datetime.datetime.now().timetuple()) 

或者Python的3.3+:

import datetime 

now = datetime.datetime.now().timestamp()