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.
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
Add admonition about Date functions now using UTC #360
base: master
Are you sure you want to change the base?
Add admonition about Date functions now using UTC #360
Changes from 1 commit
1440a8e
09cea0c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most relevant place for this information is with the
toDate()
andtoString()
documentation, although those should probably be brief references to a more general discussion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to have this generally at the beginning of discussing all the Date functions.
But would love your help on the
toString()
documentation suggestions which I can add in this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but since it caught my eye, ISO 8601 isn't involved. Although this does the same thing as before, due to the changes in
toString()
, the effective date/time is different.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand. This is the
now()
function directly, which returns a date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, according to the Java docs. So I think this reads OK as is? But I think your point is that we need to improve thetoString()
documentation more fully? I can do that in this PR also.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's wrong...
now()
will always return the date-time from the users system clock in the specified time-zone (which isZ
according to our code , which means Zulu time, which means we return the users system time without any offset.)So should
now()
docs stay as is, because it does return the users system clock in ISO 8601 format?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only semantics, but the date handling is complicated enough without leading people astray. ISO 8601 dates are represented using strings. What the
now()
function returns is an internal OpenRefine datetime object. The square brackets around "[date 2020-11-26T15:53:00Z]" and the leading "date" prefix indicate that this is the defaulttoString()
rendering for an internal date object, not a string. The expressionnow().toString() would give "2020-11-26T15:53:00Z" for the above example. Using OpenRefine 2.8,
now()returns a date object rendered as "[date 2024-08-20T17:16:42Z]" while
now().toString()` returns "Aug 20, 2024" using my default system locale and now().toString("hh:mm a z") return "05:20 PM EDT" which matches the current local wall clock time.In addition to date to string conversions, import/export from spreadsheet formats like Excel and OpenOffice behave differently as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, so you want to document that OpenRefine prior to 3.0 handled this differently? If that is your concern, I think it's less important how prior 3.0 handled things and just document how they currently work over the last few versions. Our surveys show that everyone is using at least OpenRefine 3.7+ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole point of #6009 is documenting (instead of fixing) the date handling regression. If that's not what this is addressing, you should remove the tag.
The discussion of
now()
is separate. It doesn't return an ISO 8601 formatted string. It returns a datetime.I'll let you and @ostephens decide how you're going to document this. My preference was to fix the bugs, but I got overruled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tfmorris Can you express how you would word things?