Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 23 lines (19 sloc) 0.535 kb
16c3258 Maximilian Weber initial upload
damaex17 authored
1 #!/usr/bin/python
2 import time
3 import datetime
4 import sys
5 #
6 # script calculates the time sind epoch (1970-01-01 00:00am UTC)
7 #
8
9 if len(sys.argv) < 2:
10 print "Usage: %s 2011-10-25 [19:30:00]" % (sys.argv[0])
11 sys.exit(1)
12 elif len(sys.argv) !=3:
13 u_time = "00:00:00"
14 else:
15 u_time = sys.argv[2]
16
17 u_date = sys.argv[1]
18 u_input = "%s %s" % (u_date, u_time)
19 print "epoch for given time: \t %s" % (int(time.mktime(time.strptime(u_input, '%Y-%m-%d %H:%M:%S'))))
20 now = int( time.time() )
21 print "epoch timezone: \t %s" % (now)
22
Something went wrong with that request. Please try again.