tag:blogger.com,1999:blog-7884492825228653821.post4019038693450742285..comments2024-03-08T15:14:19.603+05:30Comments on CrazyTechThoughts: Get current UTC timestamp in PythonSarbajit Chatterjeehttp://www.blogger.com/profile/07178321902250011434noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7884492825228653821.post-89187790615559870792014-04-01T07:23:31.930+05:302014-04-01T07:23:31.930+05:30Both methods return same timestamp values.Both methods return same timestamp values.Zheyuanhttps://www.blogger.com/profile/13509079722152378865noreply@blogger.comtag:blogger.com,1999:blog-7884492825228653821.post-30481454363159805852013-09-21T23:11:04.281+05:302013-09-21T23:11:04.281+05:30Precisely that is what I observed that time. It wa...Precisely that is what I observed that time. It was Ubuntu 10.04/python 2.6 as far as I remember.Sarbajit Chatterjeehttps://www.blogger.com/profile/07178321902250011434noreply@blogger.comtag:blogger.com,1999:blog-7884492825228653821.post-35530035750004229232013-09-06T02:57:27.182+05:302013-09-06T02:57:27.182+05:30Are you saying that the value you are getting for ...Are you saying that the value you are getting for epoch_time_in_local_timezone is different from current_utc_time_in_sec? Everything I've read says that time.time() is seconds from the epoch, which in almost every machine is from 1970-01-01, 00:00 UTC (see http://stackoverflow.com/a/11845878/2016290). Also, it looks like the source code for datetime.datetime.utcnow() and time.time() both end up using _PyTime_gettimeofday() to get the current time (see Modules/_datetimemodule.c and Modules/timemodule.c in http://hg.python.org/cpython).Anonymoushttps://www.blogger.com/profile/11844597221969534301noreply@blogger.com