> -----Original Message-----
> From: munroel
> Subject: Date problem
>
> Hi All
>
> I am retreving the date for an application using
> TimGetSeconds, secondstoDate
> and Datetoascii. The day and month values are correct, but
> the the year value
> is all 1999. Does anyone know of a fix for this....
You are erronously passing the seconds value into DateSecondsToDate(),
instead of TimSecondsToDateTime(). It's that simple, and yet so
frustratingly complicated at the same time. I've pulled out many hairs
over this one.
You want to do something like this:
DateTimeType dtt;
Char szDate[80];
TimSecondsToDateTime( TimGetSeconds(), &dtt ); // <-- don't use
DateSecondsToDate() here
DateToAscii( dtt.month, dtt.day, dtt.year,
(DateFormatType)PrefGetPreference( prefDateFormat ),
&szDate[0]);
-Jeff Ishaq
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/