You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the referenced magic number 1546261200 is Mon Dec 31 2018 13:00:00 GMT+0000 in UTC. I also think the provided example is more readable. Maybe someone could consider to update this? If I find time I will provide a PR.
The text was updated successfully, but these errors were encountered:
I agree, the number in the code looks wrong.
One thought: if you put the call to datetime into the timestamp_2019 function, then Python will end up re-running the code to recalculate this constant value every time it is called.
So maybe calculate it in __init__ so that its only done once, or hard code the right value with a suitable comment about how you got it.
Also, from unix epoch of 1st Jan 1970, the maths could be also be done without time functions, something like this: 3600*24*int(365.25*(2019-1970))
Or more generically (valid between 1901 and 2100):
Hi there
I just stumbled across this line of code and was wondering if it shouldn't be
Because the referenced magic number 1546261200 is Mon Dec 31 2018 13:00:00 GMT+0000 in UTC. I also think the provided example is more readable. Maybe someone could consider to update this? If I find time I will provide a PR.
The text was updated successfully, but these errors were encountered: