Skip to content

Comment on Fix date-handling bug when today’s date is later than the target monthparent

Comments

To have a better understanding of what operations you are trying to do. I can't answer your question specifically because it depends a lot on use case and what date/time standards you want to use.

To expand on this a little, there are operations that have slightly ambiguous meanings/can end up with different answers depending on your assumptions.

e.g. If today is the 30th of January 2024. What is the date in 1 months time?

Should it be the 29th of February? (as the 30th doesn't exist). The 28th? (the penultimate day of the month, like the 30th of Jan). The 1st of March (a 'standard' month should be considered 30 days, so 30 days from now).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.