Re: Date parsing
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jun 10, 2008, 15:10 UTC
- Message-ID
- <Zx2uvEYSssjj9E0HrmUL8wYASyWX9L9w8LkR-gGRAmnD9isjoEeyKg@cipher.nrlssc.navy.mil>
- In-Reply-To
- <bd6139dc0806100758xb41d08dh18e3051088b707e5@mail.gmail.com>
Sverre Rabbelier wrote:
Show 9 quoted lines
> Heya, > > I noticed that we parse > GIT_COMMITTER_DATE="31-05-2008 11:30pm" as "31st of July at 23:30 +0200" > whereas we parse > GIT_COMMITTER_DATE="01-06-2008 11:30pm" as "6th of January at 23:30 +0100" > > Not only is it strange that we accept both orders (since apparently we > don't resort to the latter order unless the first digit > 12),
Take a look at match_multi_number in date.c European ordering is preferred when the separator is '.'
> but > it's also weird that the timezone changes based on which option was > chosen!
The timezone didn't change. One date is in daylight saving time, the other is not. The offset from GMT is different to reflect this.
> What does the list think about this? Is this "normal" > behavior? If not, what (if anything) should we do about it?
There will be flaws in any system that tries to automatically guess the format. If there is not already one, perhaps a statement should be added to the appropriate documentation describing how to ensure that european ordering is used to parse the date.
-brandon