Skip to content

Conversation

@javisanesp
Copy link

Hello there,

We noticed, thanks to my colleague @javiergm1983, that the constant value SECONDS_IN_YEAR is not correct. I do not know if you did it on purpose but following the standard convention, if it is considered a Gregorian year (365.2425 days), and a day are 86400 seconds, its value should be 52 seconds more.

SECONDS_IN_YEAR = (365.2425 days) * (86400 seconds/day) = 31556952 seconds

I took the liberty to add a few new constants that somebody might find useful:

SECONDS_IN_COMMON_YEAR = (365 days) * (86400 seconds/day) = 31536000 seconds
SECONDS_IN_JULIAN_YEAR = (365.25 days) * (86400 seconds/day) = 31557600 seconds
SECONDS_IN_LEAP_YEAR = (366 days) * (86400 seconds/day) = 31622400 seconds

Please let me know if you like and found this code useful.

Thank you.

Cheers!

- Changed value of SECONDS_IN_YEAR from '31556900' to '31556952', it had 52 seconds less, if it is considered a Gregorian year.
SECONDS_IN_YEAR = (365.2425 days) * (86400 seconds/day) = 31556952 seconds

- And added the following constants:

SECONDS_IN_COMMON_YEAR = (365 days) * (86400 seconds/day) = 31536000 seconds
SECONDS_IN_JULIAN_YEAR = (365.25 days) * (86400 seconds/day) = 31557600 seconds
SECONDS_IN_LEAP_YEAR = (366 days) * (86400 seconds/day) = 31622400 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant