Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Disambiguation of two-digit years #217

Open
GiovanniSalmeri opened this issue Apr 25, 2019 · 1 comment
Open

Disambiguation of two-digit years #217

GiovanniSalmeri opened this issue Apr 25, 2019 · 1 comment

Comments

@GiovanniSalmeri
Copy link

GiovanniSalmeri commented Apr 25, 2019

If PickMeUp intends to follow the same rule of Excel, line 599 in pickmeup.js should be:

y += y > 99 ? 0 : (y < 30 ? 2000 : 1900);

Anyway, the condtion y > 100 as now stands does not seem to be correct, because it interprets 100 as 2000, which is never intended.

Just for completeness, I have found two other existing conventions:

PHP, function strtotime:
If the number of the year is specified in a two digit format, the values between 00-69 are mapped to 2000-2069 and 70-99 to 1970-1999. See the notes below for possible differences on 32bit systems (possible dates might end on 2038-01-19 03:14:07).

POSIX:
Values 00 to 68 are prefixed by 20 and 69 to 99 by 19 – that is the behaviour specified by the 2004 and 2008 POSIX standards.

@nazar-pc
Copy link
Owner

nazar-pc commented May 2, 2019

I have no strong opinion on this, feel free to create a PR for improving this behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants