with python's datetime package, I'm seeing a ~8min time difference between datetime.now().timestamp() and datetime(year, month, day, hour, minute, second, [tz]).timestamp(), when I put now's time in the latter formula. With or without the tz, which is timezone, the 8min difference stays there. Anyone can explain where it went wrong? Thanks!
-
1Please post a Minimal, complete, verifiable example, just a few lines to illustrate your problem.Prune– Prune2017-11-21 01:34:34 +00:00Commented Nov 21, 2017 at 1:34
-
let's say now is nov 20, 17:44, pacific time. with datetime.now().timestamp(), I got a number 1511228640. This is equal to the actual utc time. But when I used datetime(2017, 11, 20, 17, 44, 0, 0, [pacific_time]), I got 1511228220, which 420 seconds, i.e. 7 minutes different from the actual utc. And the pacific_time tz variable's existence doesn't make a difference.Alison Z– Alison Z2017-11-21 01:48:39 +00:00Commented Nov 21, 2017 at 1:48
-
I'll check back in the morning to see whether you've posted (not commented) a MCVE (not narration).Prune– Prune2017-11-21 01:55:38 +00:00Commented Nov 21, 2017 at 1:55
Add a comment
|