pendulum
pendulum copied to clipboard
timestamp function returns wrong timestamp for timezone initialize now or atleast syntax is very misleading
I am using Pendulum '2.0.5'
pendulum.now('Asia/Kathmandu').timestamp() 1564462471.720615
pendulum.now('Asia/Singapore').timestamp() 1564462476.96399
The timezone difference between Kathmandu and Singapore is 2.25 hr, but above shows just 5 seconds different. Coincidence is that I executed both of them in 5 secs different.
As you can see, the syntax is misleading which I never expected. I kept debugging my code when there was issue with pendulum.
Looks like the timestamp() funciton is unix timestamp which returns UTC seconds. And this is same across all timezones. Hence closing the issue.