What is the easiest way to get current GMT time in Unix timestamp format?
I would use time.time() to get a timestamp in seconds since the epoch.
import timetime.time()
Output:
1369550494.884832
For the standard CPython implementation on most platforms this will return a UTC value.
Does this help?
from datetime import datetimeimport calendard = datetime.utcnow()unixtime = calendar.timegm(d.utctimetuple())print unixtime