Re: RFC: date parser rewrite
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-12-16 16:54:46 CET
mark benedetto king wrote:
Indeed. As I said (below), it's not a terribly great solution. Nevertheless I thought it was worth considering as it would avoid a bunch of coding work just as we are trying to stabilise.
>>I admit that just documenting that only a few of the accepted formats are
I'll mention the "svn log" case in a separate thread.
> Even documenting the existing implementation is difficult.
That's irrelevant. I was suggesting that we just document that the only supported format is "YYYY-MM-DD hh:mm:ss" and it means local time (and/or a very small number of other simple formats).
>>>1.) the following ISO 8601 extended date-time formats:
>>>Where "TZI" stands for "Time Zone Indicator", and can be one of:
i.e. add "YYYY-MM-DDTZI" to the list in (1) and "YYYYMMDDTZI" to the list in (2). That would add date-only formats with a non-empty TZI to the current proposal, but I think that makes sense and is a good thing for consistency. e.g. a GUI might allow the user to enter a date and/or time, and the program could then apend the TZI itself without knowing which format the user entered.
>>>4.) the following formats, which are presumed to reference midnight
>>>5.) the following formats, which are presumed to reference local time
You smile, but the question is worth answering.
Well, we could make it (now - 23 hours) to (now + 1 hour). The "+" side only needs a few minutes to overcome clock skew, so "+ 1 hour" is plenty. However, we could also say that this format is only appropriate for recent times - much less than a day - and if the event was anywhere approaching a day ago, i.e. more than half a day ago, then you need to use a different format.
>>"current day" should mean the period of <= 24 hours that ends at least few
Simpler, but not much so, but I won't force the issue. In that case I think we should require that the specified time be between 00:00 and "now", so that both semantics (other times meaning "later today" and other times meaning "yesterday") are reserved for a future extension.
This is an archived mail posted to the Subversion Dev mailing list.