* Approxidate with YYYY.MM @ 2011-05-09 19:02 Brian Gernhardt 2011-05-10 6:35 ` Michael J Gruber 0 siblings, 1 reply; 7+ messages in thread From: Brian Gernhardt @ 2011-05-09 19:02 UTC (permalink / raw) To: git@vger.kernel.org List (This is in response to a discussion on #parrot.) Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form YYYY.MM for their monthly releases. When we were attempting to find the cause of a slowdown, somewhat was trying to find what commits occurred after the 2011.01 release with "git log --after=2011.01". His mistake was pointed out but this led to the confusion of why this was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't date.c:match_multi_number() parse something with only two numbers as a beginning of month instead of allowing it to pass through to the generic parsing? I'm currently nearing finals in school, so lack the time for an RFC patch at the moment. ~~ Brian ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Approxidate with YYYY.MM 2011-05-09 19:02 Approxidate with YYYY.MM Brian Gernhardt @ 2011-05-10 6:35 ` Michael J Gruber 2011-05-10 6:54 ` Andreas Ericsson [not found] ` <964517.31047.1305010481774.JavaMail.trustmail@mail1.terreactive.ch> 0 siblings, 2 replies; 7+ messages in thread From: Michael J Gruber @ 2011-05-10 6:35 UTC (permalink / raw) To: Brian Gernhardt; +Cc: git@vger.kernel.org List Brian Gernhardt venit, vidit, dixit 09.05.2011 21:02: > (This is in response to a discussion on #parrot.) > > Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form > YYYY.MM for their monthly releases. When we were attempting to find > the cause of a slowdown, somewhat was trying to find what commits > occurred after the 2011.01 release with "git log --after=2011.01". > His mistake was pointed out but this led to the confusion of why this > was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't > date.c:match_multi_number() parse something with only two numbers as > a beginning of month instead of allowing it to pass through to the > generic parsing? I just don't think there is a format like that. There is dd.mm.[yy]yy and apparently also yyyy.mm.dd, but without leading zeros in mm for the latter. Our date parser also takes "." for a space so that you don't need to quote a space ("1.day.ago"). I can see the logic behind parsing 2011.01 as January 2011, but it's a stretch from the existing formats: http://en.wikipedia.org/wiki/Calendar_date#Date_format > I'm currently nearing finals in school, so lack the time for an RFC > patch at the moment. Good luck :) Michael ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Approxidate with YYYY.MM 2011-05-10 6:35 ` Michael J Gruber @ 2011-05-10 6:54 ` Andreas Ericsson 2011-05-10 7:08 ` Michael J Gruber [not found] ` <964517.31047.1305010481774.JavaMail.trustmail@mail1.terreactive.ch> 1 sibling, 1 reply; 7+ messages in thread From: Andreas Ericsson @ 2011-05-10 6:54 UTC (permalink / raw) To: Michael J Gruber; +Cc: Brian Gernhardt, git@vger.kernel.org List On 05/10/2011 08:35 AM, Michael J Gruber wrote: > Brian Gernhardt venit, vidit, dixit 09.05.2011 21:02: >> (This is in response to a discussion on #parrot.) >> >> Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form >> YYYY.MM for their monthly releases. When we were attempting to find >> the cause of a slowdown, somewhat was trying to find what commits >> occurred after the 2011.01 release with "git log --after=2011.01". >> His mistake was pointed out but this led to the confusion of why this >> was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't >> date.c:match_multi_number() parse something with only two numbers as >> a beginning of month instead of allowing it to pass through to the >> generic parsing? > > I just don't think there is a format like that. There is dd.mm.[yy]yy > and apparently also yyyy.mm.dd, but without leading zeros in mm for the > latter. Our date parser also takes "." for a space so that you don't > need to quote a space ("1.day.ago"). I can see the logic behind parsing > 2011.01 as January 2011, but it's a stretch from the existing formats: > It would be far more logical to parse "2011-01" as "January 2011" as that's the preferred way to write month-precision dates in most countries that use both the metric system and the gregorian calender. I've never seen that date-type with dot as a separator, but with the dash it's very, very common. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Approxidate with YYYY.MM 2011-05-10 6:54 ` Andreas Ericsson @ 2011-05-10 7:08 ` Michael J Gruber 0 siblings, 0 replies; 7+ messages in thread From: Michael J Gruber @ 2011-05-10 7:08 UTC (permalink / raw) To: Andreas Ericsson; +Cc: Brian Gernhardt, git@vger.kernel.org List Andreas Ericsson venit, vidit, dixit 10.05.2011 08:54: > On 05/10/2011 08:35 AM, Michael J Gruber wrote: >> Brian Gernhardt venit, vidit, dixit 09.05.2011 21:02: >>> (This is in response to a discussion on #parrot.) >>> >>> Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form >>> YYYY.MM for their monthly releases. When we were attempting to find >>> the cause of a slowdown, somewhat was trying to find what commits >>> occurred after the 2011.01 release with "git log --after=2011.01". >>> His mistake was pointed out but this led to the confusion of why this >>> was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't >>> date.c:match_multi_number() parse something with only two numbers as >>> a beginning of month instead of allowing it to pass through to the >>> generic parsing? >> >> I just don't think there is a format like that. There is dd.mm.[yy]yy >> and apparently also yyyy.mm.dd, but without leading zeros in mm for the >> latter. Our date parser also takes "." for a space so that you don't >> need to quote a space ("1.day.ago"). I can see the logic behind parsing >> 2011.01 as January 2011, but it's a stretch from the existing formats: >> > > It would be far more logical to parse "2011-01" as "January 2011" as > that's the preferred way to write month-precision dates in most > countries that use both the metric system and the gregorian calender. > > I've never seen that date-type with dot as a separator, but with the > dash it's very, very common. > Exactly that's what I wrote. People misuse the dot format probably as frequently as the dash format, in the sense that the use an ordering which is wrong for the respective separator. We currently parse n.m as day n of month m of the current year for certain n only: We parse 31.3. as March 3rd of the current year 32.3. as May 3rd of 2032 (because May is the current month) which does not make that much sense, admittedly. I would have hoped the latter to be April 1st (current year). I agree that defaulting the month to the current month in the dot format makes no sense, but I think (and I guess we disagree here) that it's a matter of garbage in - garbage out. As for turning that garbage into marbles: 32.3. == 1.4. seems more logical to me. Note that for example 2020.9.11 -> 2020-11-09 07:06:16 +0000 which means that we *never* parse the Chinese yyyy.mm.dd correctly, not even the complete form! Michael ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <964517.31047.1305010481774.JavaMail.trustmail@mail1.terreactive.ch>]
* Re: Approxidate with YYYY.MM [not found] ` <964517.31047.1305010481774.JavaMail.trustmail@mail1.terreactive.ch> @ 2011-05-10 7:40 ` Victor Engmark 2011-05-10 8:36 ` Michael J Gruber 0 siblings, 1 reply; 7+ messages in thread From: Victor Engmark @ 2011-05-10 7:40 UTC (permalink / raw) To: Andreas Ericsson Cc: Michael J Gruber, Brian Gernhardt, git@vger.kernel.org List On 05/10/2011 08:54 AM, Andreas Ericsson wrote: > On 05/10/2011 08:35 AM, Michael J Gruber wrote: >> Brian Gernhardt venit, vidit, dixit 09.05.2011 21:02: >>> (This is in response to a discussion on #parrot.) >>> >>> Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form >>> YYYY.MM for their monthly releases. When we were attempting to find >>> the cause of a slowdown, somewhat was trying to find what commits >>> occurred after the 2011.01 release with "git log --after=2011.01". >>> His mistake was pointed out but this led to the confusion of why this >>> was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't >>> date.c:match_multi_number() parse something with only two numbers as >>> a beginning of month instead of allowing it to pass through to the >>> generic parsing? >> >> I just don't think there is a format like that. There is dd.mm.[yy]yy >> and apparently also yyyy.mm.dd, but without leading zeros in mm for the >> latter. Our date parser also takes "." for a space so that you don't >> need to quote a space ("1.day.ago"). I can see the logic behind parsing >> 2011.01 as January 2011, but it's a stretch from the existing formats: >> > > It would be far more logical to parse "2011-01" as "January 2011" as > that's the preferred way to write month-precision dates in most > countries that use both the metric system and the gregorian calender. > > I've never seen that date-type with dot as a separator, but with the > dash it's very, very common. Seconded. ISO dates are getting pretty common, and in the extended format hyphens are the default separator between year, month, and date <https://secure.wikimedia.org/wikipedia/en/wiki/ISO_8601#Calendar_dates>. A few notes on support: GNU `date` 8.5 parses some ISO date strings correctly: $ date --date='2001-02-03' +%Y-%m-%d\ %H:%M:%S 2001-02-03 00:00:00 $ date --date='2001-02-03 04:05:06' +%Y-%m-%d\ %H:%M:%S 2001-02-03 04:05:06 Unfortunately, it doesn't handle partial dates: $ date --date='2001-02' +%Y-%m-%d\ %H:%M:%S date: invalid date `2001-02' But it does handle HH:MM: $ date --date='04:05' +%Y-%m-%d\ %H:%M:%S 2011-05-10 04:05:00 Basic format dates are sometimes parsed correctly: $ date --date='20010203' +%Y-%m-%d\ %H:%M:%S 2001-02-03 00:00:00 But not with seconds: $ date --date='20010203040506' +%Y-%m-%d\ %H:%M:%S 2001020304-05-06 00:00:00 The W3C recommends the use of ISO dates: <http://www.w3.org/QA/Tips/iso-date>, and their standards, like XML, typically support only ISO dates (or a subset thereof). Cheers, Victor Engmark ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Approxidate with YYYY.MM 2011-05-10 7:40 ` Victor Engmark @ 2011-05-10 8:36 ` Michael J Gruber 2011-05-22 17:10 ` Michael Witten 0 siblings, 1 reply; 7+ messages in thread From: Michael J Gruber @ 2011-05-10 8:36 UTC (permalink / raw) To: Victor Engmark Cc: Andreas Ericsson, Brian Gernhardt, git@vger.kernel.org List Victor Engmark venit, vidit, dixit 10.05.2011 09:40: > On 05/10/2011 08:54 AM, Andreas Ericsson wrote: >> On 05/10/2011 08:35 AM, Michael J Gruber wrote: >>> Brian Gernhardt venit, vidit, dixit 09.05.2011 21:02: >>>> (This is in response to a discussion on #parrot.) >>>> >>>> Rakudo (https://github.com/rakudo/rakudo/) uses tags of the form >>>> YYYY.MM for their monthly releases. When we were attempting to find >>>> the cause of a slowdown, somewhat was trying to find what commits >>>> occurred after the 2011.01 release with "git log --after=2011.01". >>>> His mistake was pointed out but this led to the confusion of why this >>>> was parsed as "May 1 2011" instead of "Jan 1 2011". Shouldn't >>>> date.c:match_multi_number() parse something with only two numbers as >>>> a beginning of month instead of allowing it to pass through to the >>>> generic parsing? >>> >>> I just don't think there is a format like that. There is dd.mm.[yy]yy >>> and apparently also yyyy.mm.dd, but without leading zeros in mm for the >>> latter. Our date parser also takes "." for a space so that you don't >>> need to quote a space ("1.day.ago"). I can see the logic behind parsing >>> 2011.01 as January 2011, but it's a stretch from the existing formats: >>> >> >> It would be far more logical to parse "2011-01" as "January 2011" as >> that's the preferred way to write month-precision dates in most >> countries that use both the metric system and the gregorian calender. >> >> I've never seen that date-type with dot as a separator, but with the >> dash it's very, very common. > > Seconded. ISO dates are getting pretty common, and in the extended > format hyphens are the default separator between year, month, and date > <https://secure.wikimedia.org/wikipedia/en/wiki/ISO_8601#Calendar_dates>. Please, guys, this is not about ISO dates. It's about abbreviations of yyyy.mm.dd, and that is not ISO at all! Incidentally, we do not parse 2010-3 as March of 2010 either. Again, this is not ISO date format (but an unofficial abbreviation). We may decide to dwim that to 2010-03-01, and I would even appreciate that. But yyyy.mm.dd is a format we don't support at all (because it's no standard), so before supporting an abbreviation we would have to decide about supporting that format. > A few notes on support: [notes about ISO dates cut] Michael ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Approxidate with YYYY.MM 2011-05-10 8:36 ` Michael J Gruber @ 2011-05-22 17:10 ` Michael Witten 0 siblings, 0 replies; 7+ messages in thread From: Michael Witten @ 2011-05-22 17:10 UTC (permalink / raw) To: Michael J Gruber Cc: Victor Engmark, Andreas Ericsson, Brian Gernhardt, git@vger.kernel.org List On Tue, May 10, 2011 at 08:36, Michael J Gruber <git@drmicha.warpmail.net> wrote: > Incidentally, we do not parse 2010-3 as March of 2010 either. Again, > this is not ISO date format (but an unofficial abbreviation). We may > decide to dwim that to 2010-03-01, and I would even appreciate that. Wouldn't it make the most sense to provide another option to allow the user to specify whatever date format he wants (from the conversion specifiers understood by strptime(3))? It seems really ridiculous to keep growing the date parsing code. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-22 17:10 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-05-09 19:02 Approxidate with YYYY.MM Brian Gernhardt 2011-05-10 6:35 ` Michael J Gruber 2011-05-10 6:54 ` Andreas Ericsson 2011-05-10 7:08 ` Michael J Gruber [not found] ` <964517.31047.1305010481774.JavaMail.trustmail@mail1.terreactive.ch> 2011-05-10 7:40 ` Victor Engmark 2011-05-10 8:36 ` Michael J Gruber 2011-05-22 17:10 ` Michael Witten
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).