add conversion of date to integer timestamp
This commit is contained in:
parent
a577b6cbf4
commit
808103ac78
1 changed files with 3 additions and 0 deletions
|
@ -27,6 +27,9 @@ from datetime import datetime
|
|||
def getTimeStamp():
|
||||
return int(time.time())
|
||||
|
||||
def date2TimeStamp(d):
|
||||
return int(time.mktime(d.timetuple()))
|
||||
|
||||
|
||||
def timeStamp2Date(ts, useGM=False):
|
||||
if ts is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue