Re: GDate




On Tue, 24 Nov 1998, Tor Lillqvist wrote:
> 
> Hmm, that would be possible. Output for instance 1996-11-24 in %x
> format and look for what order the strings "1996" (or "96"), "11", and
> "24" are in the output.

I'm going to implement this then. Probably also some way to force a
particular order (in case I'm in Europe but want to parse US dates, or
whatever).

> Hmm, this breaks if the preferred format uses
> month names. 

I can make some minimal effort to find %b or %B in the %x output, I guess. 
If the locale's format is too weird, we are just going to have to give up
and use a default though. Perhaps people will submit patches to handle
other cases. (For example, I don't know how or if this will all work in
Asia.) 

The only issue is whether g_date_set_parse() works, of course, the rest of
the library won't depend on this kind of heuristic.

> (Are there locales that use the Islam or some other
> non-Gregorian calendar?)
> 

If so people will have to send patches, because I have no clue how to
handle it. :-)  These locales probably don't want to use the library
anyway, since all the calculations are on Gregorian dates.

I should point that out: the g_date_* routines project the Gregorian
calendar backward and forward in time. They don't try to be historically
accurate (i.e. we are ignoring the fact that the Gregorian calendar has
only been in use a few hundred years). This makes things much more
efficient, and is the right thing to do for most modern applications.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]