New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Time::Piece with DateTime #461
Comments
I'd probably discourage DateTime to some extent, as it has some API choices that can't be removed and are footguns. https://rjbs.manxome.org/rubric/entry/1929 Or something similarly sensible would be recommended. |
Yeah, but DateTime::Format::Strptime doesn't make DateTime::Moonpig objects... DateTime::Tiny can't format. Date::Parse suffers the same bug as Time::Piece. Is there something simple and not terrible that can I'm of the opinion that only ISO8601 dates should be accepted as input by Statocles, and that's easy enough to parse, so I think I'll try getting DateTime::Moonpig objects in there. It's only an accident of history that we have to output other date formats (RSS uses RFC822 dates, why?). |
DateTime::Moonpig / DateTime do not have the |
I could install a DateTime::Moonpig::tzoffset method as a temporary measure (warning when it is used) to smooth the transition... |
This should allow users time to fix their templates, along with instructions on how to do so. Refs #461
The Time::Piece module is based on the
tm
struct of the underlying OS. This can result in complications, including an inability to parse date/time before 1900-01-01.The DateTime module can correctly express dates and times in any range. It is pure-Perl, so easily installed. Instead of using Time::Piece, we should switch to DateTime for our internal date representations.
This may be a breaking change. Worse, it may be a breaking change in the templates, since some templates require the use of formatted date and time. If this is a breaking change, if possible, we should try to smooth the process with a wrapper class (like
Statocles::DateTime
or something).The text was updated successfully, but these errors were encountered: