commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <>
Subject RE: [lang] DateUtils.parseCVS
Date Wed, 07 Jul 2004 18:41:55 GMT
What about support for other languages? Quite complicated IMHO. This
feels less and less like a true [lang] but more like a

Strictly speaking Date in is java.util not java.lang ;-)

All of this to say that there is perhaps a need for a [time] and [date]
project. But again, it would be silly to duplicate joda-time.


> -----Original Message-----
> From: Serge Knystautas []
> Sent: Wednesday, July 07, 2004 10:37
> To: Jakarta Commons Developers List
> Subject: Re: [lang] DateUtils.parseCVS
> Steven Caswell wrote:
> > That does make things a little clearer. Perhaps it should be it's
> > class, with a parse and a format method, a la SimpleDateFormat.
> I'm unclear how the format part would work.  "yesterday", "1 day ago",
> and "24 hours ago" all parse to the same Date object, so I don't know
> how to provide formatting preferences.  AFAIK CVS does not support
> compound "ago"s, so while nice, it would be harder to do "1 day and 2
> hours ago".
> Another problem with formatting is due to the fact that parsing rules
> are relative to the current time.  For example, if it is 2004/07/07
> 1:28PM EST when I call parseCVS with "yesterday", I get 2004/07/06
> 1:28PM EST.  Assuming we want to follow the DateFormat API, we could
> public TBNDateFormat() -> constructor assumes relative to now
> public TBNDateFormat(Date) -> constructor uses that date
> (TBN = to be named)
> Also, the parsing also is geared towards the past, so you'd want to
> "next <datename>" to balance "last <datename>".  Any ideas of what is
> the opposite of "ago"?
> I don't have huge need for this richer API right now, but if people
> could give some suggestions on how to resolve the above issues (and
> possibly a name), I'll be happy to tackle it, splitting it into a
> separate class, and updating test cases.  Also, it looks like the
> constants dateFormats that it falls back to are missing from source,
> I would have those from my original submission.
> --
> Serge Knystautas
> Lokitech >> software . strategy . design >>
> p. 301.656.5501
> e.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message