Re: [Evolution] Islamic Calendar Support File (Progress!)

On Mon, 24 Apr 2000 10:45:08 PDT, "Ray Lee" wrote:

Careful, -1 is most certainly NOT a valid time. Any code that relies 
negative time_t's is broken. In fact, some implementations define 
via a "typedef unsigned long time_t". And to be utterly pedantic 
upon error the routines return the value -1 cast into a time_t, not
negative one.

If that's the case, what *is* the recommended way of handling dates 
prior to 1970?  It can't be the case that Unix/libc can't store dates 
prior to the Epoch, but without negative time_t's, I'm at a loss as 
to how to do it.  (If it is, it is a perfectly good reason, in my 
opinion, to reimplement the time functions.  I suppose we could 
simply disallow appointments prior to 1970 (since they could only be 
archival anyway), but that seems a less than ideal situation.)

(I'm not disputing your statement, BTW: calling mktime() on a struct 
tm before the epoch returns (time_t) -1 as an invalid date).

This made sense to me. i.e. Once the EvolutionTime (For
timezone's) is done

Grrreeeeaaaat. Okay, I'm about to stick my foot in my mouth here, but
foreknowledge isn't going to stop me. Why is there an EvolutionTime 
the standard C library handles times just fine by itself? I can see
needing to add code to deal with other timezones other than your own
(converting from them to localtime), but after that, what else do you
really need?

This one I should clarify, since I'm the one who mentioned the type 
to Ali in the first place.  You need not fear--- I'm not planning on 
reimplementing the libc code.  It will just be something like:

typedef struct { time_t t; EvolutionTimeZone* tz; } EvolutionTime;

where tz points into a global timezone database.  (That part we need 
to reimplement, since the iCalendar spec allows the creation and use 
of arbitrary timezone definitions, so we can't rely on the libc 
timezone database.  It sucks, I know, but I didn't write the spec.)


Russell Steinthal    | An RFD to create soc.culture.jewish.moderated
<rms39 columbia edu> | is currently being discussed in news.groups---
<steintr nj org>     | come and let your feelings be known!

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