-
Notifications
You must be signed in to change notification settings - Fork 327
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
Migrate away from SimpleDateFormat #748
Comments
This is actually a follow-up of #726. We solved it in shiro by using maven and forcing the JVM to use UTC: It is not a nice solution. The reason this happens is that Date() will always add time information, even when none is given. |
Addendum:
|
Should be fairly straight forward to alter the code that parse the date to use something other than SimpleDateFormat. Quick check suggests changes would be needed in MarkupEngine and AsciidoctorEngine, maybe elsewhere too. Ideally java.util.Date would be replaced, due to the problems it causes, however this requires the template engines to support the replacement too. |
If you like, I can start a PR about this. I know Freemarker can cope with it. |
Hi,
the current default date format is
yyyy-MM-dd
.However, I need time information to create a valid atom feed.
That said,
SimpleDateFormat
does not allow timezone information like2022-01-01T21:20:40[Europe/Berlin]
.The offset it provides might be ambiguous, so the actual timezone name is needed for calculations.
Proposal to:
java.time.ZonedDateTime
java.time.DateTimeFormatter
ZonedDateTime.parse(String)
) or set it to something like the default oryyyy-MM-dd HH:mm:ss[V]
the default templates should reflect this and use
post.published_date?datetime?string.iso
(without zone conversion) where possible andpost.published_date?datetime?string.iso_utc
where feasible (e.g. in machine-readable data).The text was updated successfully, but these errors were encountered: