Merge branch 'bbmaster' of ssh://git.cy55.de/home/git/cybertools into bbmaster
This commit is contained in:
commit
8f1951d8cb
1 changed files with 4 additions and 3 deletions
|
@ -51,13 +51,14 @@ def formatTimeStamp(ts, useGM=False, format='%Y-%m-%d %H:%M'):
|
|||
|
||||
|
||||
def str2timeStamp(s):
|
||||
s = s.replace('T', ' ')
|
||||
try:
|
||||
t = time.strptime(s, '%Y-%m-%d %H:%M:%S')
|
||||
t = time.strptime(s[:19], '%Y-%m-%d %H:%M:%S')
|
||||
except ValueError:
|
||||
try:
|
||||
t = time.strptime(s, '%Y-%m-%d %H:%M')
|
||||
t = time.strptime(s[:16], '%Y-%m-%d %H:%M')
|
||||
except ValueError:
|
||||
t = time.strptime(s, '%Y-%m-%d')
|
||||
t = time.strptime(s[:10], '%Y-%m-%d')
|
||||
return int(time.mktime(t))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue