csv: convert datetimes with time zones to local date, mostly (WIP) #1583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just sharing this.. it's an attempt to fix this CSV limitation I just noticed, dates from other timezones can be off by one:
fc364cd origin/master ;doc: csv: note a limitation with datetimes in other zones
I have abandoned it for now, because (in a non-UTC timezone) dates with no time/timezone all get adjusted, as they are parsed as 00:00:00 UTC. Perhaps with a bit more work this could be useful (somehow use local timezone as the default when parsing ? Convert to local date only when timezone-related strptime codes (%z, %ez, %Z, %eZ) appear in date-format ?
Related: haskell/time#172.
This PR doesn't handle the daylight-savings inaccuracy mentioned there, but I think it would still improve the date in most cases (off by one errors would still be possible, but rather rare for most people). Adding the<- a mistake ? Hopefully.tz
package as a dependency could allow "perfect" accuracy, but only for past dates, as far as I understand it.