-
Notifications
You must be signed in to change notification settings - Fork 207
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
strptime discards timezone information parsed from %z specifier #359
Comments
Noticed this while parsing some Apache logs with |
This will be addressed by the Go port. |
@Sharpie sorry for the long delay! The Go port has been a long process and I'm doing datetime mods as one of the final steps. In Miller 6 this works as expected:
|
No worries about the delay! Thanks for building such an amazing tool --- |
When parsing date strings, the
strptime
function appears to discard time zone information provided by the%z
format specifier and always uses the time zone of the machine runningmlr
.Reproduction Case
Round-tripping a RFC 3339 date through
mlr
results in Midnight, 4 hours west of UTC being printed as Midnight UTC.Expected Behavior
mlr
shifts the parsed date to UTC and prints 4 AM UTC, asdate
does:Or,
mlr
retains the time zone information asruby
does:Workaround
Provided all timestamps being parsed are from the same time zone, running
mlr
with theTZ
environment variable set to that time zone and usingstrptime_local
will produce the expected results:The text was updated successfully, but these errors were encountered: