Hi everybody,
I've been trying to get the current date as a string, and set a Select
Trigger's label to it:
---- Code Snippet ----
CharPtr currDateStr = MemPtrNew(dateStringLength);
DatePtr currDate = MemPtrNew(sizeof(DateType));
ULong dateInSeconds;
dateInSeconds = TimGetSeconds();
DateSecondsToDate(gDateInSeconds, currDate); // Initialise the current date.
DateToAscii(currDate->month, currDate->day, currDate->year,
dfDMYWithSlashes, currDateStr);
CtlSetLabel(GetObjectPtr(frmLogEntryDateSelectSelTrigger), currDateStr);
---- End Code Snippet ----
The current date (according to the Palm Emulator) is 26/11/1999.
However, the DateToAscii() stores 25/11/95 to currDateStr.
When I try
DateSecondsToDate(TimGetSeconds(), currDate); // Initialise the current
date.
It gives me the same result.
I also use the DateToAscii() again after calling the Date Selection Dialog
box, and it returns the correct date.
I am therefore assuming that something is going wrong in or around
TimGetSeconds().
Any Ideas? I haven't been able to try it on a Palm Device as yet, and I am
using the Eval CodeWarrior v.5.
Thanks,
Robert Foster
Mountain Visions P/L
[EMAIL PROTECTED]