-
Notifications
You must be signed in to change notification settings - Fork 12
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
Date.date #7
Comments
Regarding the first example: we are always converting to UTC, because otherwise a number of important calculations would become insanely difficult or simply impossible. The date is still correct, so you can calculate it according to your desired timezone. If you are just interested in the string representation (i.e., get
Similarly for the second example, don't use the date library if you just want to parse the numbers:
The point of the date library is to manipulate dates and convert them back to EDTF strings. For that reason, we're using the concept that every extended date covers a period of time with a min/max value. This approach is necessary to do computations, that's why the day exists, even though the date has year precision (you can still query the precision and convert the date back to a string and you will see that there is no day set, but because it is required for computations you can still get an approximation if you need it). |
Please do let me know if this is not the proper channel... if I parse |
Or could I just use |
Yes, you can either use the extended date objects directly, or, alternatively, use the Bitmask class (unspecified and uncertain are simply Bitmask instances created from the numeric value returned by the parser). |
I'm trying to get the day-of-month value from a parsed date, but I'm getting some things I didn't expect:
edtf('2016-07-18T20:26:06+10:00').date
= 19edtf('-0876').date
= 1I sort of get the first, but I'd still prefer to have a way to get
18
out. The 2nd, I had expectedundefined
rather than1
.The text was updated successfully, but these errors were encountered: