Am seeing strange issue when converting data time to epoch format between the languages Python and Ruby. I noticed huge difference in seconds on the same server.
In Python 3.6.2:
>>> datetime.datetime.utcnow()
datetime.datetime(2018, 1, 13, 4, 25, 19, 204056)
>>> int(datetime.datetime.utcnow().strftime("%s"))
1515839122
>>>
In Ruby 1.8.7:
irb(main):038:0> Time.now.utc
=> Sat Jan 13 04:25:18 UTC 2018
irb(main):039:0> Time.now.utc.to_i
=> 1515817520
irb(main):040:0>
Am worrying if am using wrong method in any the mentioned languages or looking way to fix this to get the same epoch seconds in both the languages. Since my application is developed to work using both the languages and the epoch time will be shared between those languages.
I believe it doesn't matter about the languages version, since the timestamp is same for irrespective of languages.