This is how I finished up doing this. It didn't work the first time
because I had entered the magic number as 2080844800! Oops!:
SecsSinceX = StrAToI(pRecord.datetime) + 2082844800;
TimSecondsToDateTime(SecsSinceX, &datetime);
StrPrintF( datestr,
"%2d/%2d/%4d %2d:%2d:%2d",
datetime.day, datetime.month, datetime.year,
datetime.hour, datetime.minute, datetime.second);
> -----Original Message-----
> From: John Marshall [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 25, 2000 7:19 PM
> To: Palm Developer Forum
> Subject: Re: Unix Time (Seconds since 1/1/1970) to Palm DateTime
> conversion
>
> Jason Garrett <[EMAIL PROTECTED]> writes:
> > Is anyone aware of a Palm function to convert unix time to Palm
> > DateTime?
>
> There are functions to convert to/from Macintosh time. So if you can
> write
> Unix<->Mac functions, you're done.
>
> > Does anyone have an algorithmn?
>
> If you want to be correct, take a look at pfdtime.c in prc-tools at
> http://homepages.enterprise.net/jmarshall/palmos/build-prct.html.
>
> If on the other hand you believe that standard C time is measured in
> seconds
> since 1970-01-01, the magic number is 1970epoch - 1904epoch =
> 2082844800.
>
> John "from Dunedin, myself :-)"
>
> ---
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see <http://www.palm.com/devzone/mailinglists.html>.
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html.