Re: gdate integration
- From: Jeff Garzik <jgarzik pobox com>
- To: gtk-devel-list redhat com
- Subject: Re: gdate integration
- Date: Tue, 1 Dec 1998 15:09:33 -0500 (EST)
Havoc Pennington wrote:
>
>
> On Tue, 1 Dec 1998, Aaron Digulla wrote:
> > Please use 0..6 for the valid days and -1 for the bad day. This way,
> > one can work with modulo on week days (well, more easily :-) OTOH,
> > months from 1 to 12 look more "natural" than from 0 to 11 :-/
> >
>
> I think this is too inconsistent with the rest of GDate... right now all
> values are unsigned, with 0 the invalid value... this means g_date_clear
> just zeroes the struct. If you did this then one of the values would be
> signed, and 0 would be a valid value for it, and it would be sort of
> hackish I think.
>
> You can always subtract 1 if you need to do the modulo thing (though you
> probably don't need to, since you can just use the provided functions for
> nearly any case I can think of).
>
> Re: Jeff's struct tm comment, I think one of the many reasons struct tm
> sucks is the use of numbers starting with 0, especially for months... I've
> provided g_date_to_struct_tm precisely so one doesn't have to think about
> struct tm. You can go the other way with g_date_set_time().
FWIW I agree 100% The "year + 1900" thing always pissed me off. :)
But 'agreeing' with struct tm will make life easier in a lot of
situations where GDate isn't used 100% of the time (ie. in legacy code,
etc.)
Jeff
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]