-
Notifications
You must be signed in to change notification settings - Fork 47
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
Year not identified for dates before the Unix epoch (January 1 1970) #155
Comments
It also goes wrong when you add a time. Parser input
Parser output
Parser expected output
|
Other cases in #102 |
I also have this issue. Looking at the code of moment/src/interval_constraints.rs you can see there is a hard code of 1970. On a local copy I tested what would happen if I changed this to 1900 for example and it was able to resolve dates after 1900 with the change.
Do you think we can change this value? |
@canicegen I have opened PR #212 in relation to this. |
Hello, unfortunately that's not an issue we'll be able to tackle this way. I'll let @hdlj comment and explain why :) |
Thanks for opening this issue! Rustling computes a date regarding a given context. This context gives to the algorithms the min/max date to support. The reference context is designed to be cross-platform. The issue was with Raspbian (32 bits system). It is not an issue on 64 bits. When rustling is parsing a date before 1970 on Raspbian, it will return a date between 1970 and 2038 without throwing an error. This Removing this constraint is not a good idea. However, if the platform you are using doesn't have this issue, you should be able to build the ResolverContext as you want (1900 -> 2100 or 1000 -> 3000 for instance). Unfortunately this API is not available but easy to add. Thanks for using Rustling :) !! |
@hdlj - thank you for your comments. If this is a guard to protect against 32 bit systems would you accept altering the for_reference function to check the architecture and have a conditional - something like:
That way there is not need to wire through extra API? |
Many thanks @canicegen for your comment. Indeed we should apply the restrictions only on 32bits operating system. With your approach is it working if we install a Raspbian (32 bits) on a 64 bits architecture (Raspi 3) ? In PR #212 I have added the manual API, to by pass the hardcoded span of 70 years. |
Hi @hdlj - I just did a quick test on a Raspberry Pi 3B with Raspian and it looks ok. The CPU is Broadcom bcm2837rifbg which is 64 bit.
|
Parsing Error
Rustling doesn't identify the year in dates before the Unix epoch (January 1 1970).
This is a similar issue as #102 and the same issue as my comment there, but I add this here as a new issue because I found the exact date where it goes wrong.
Version
0.17.7
Language
en
Parser input
december 31 1969
Parser output
Parser expected output
The text was updated successfully, but these errors were encountered: