This is very strange. I have some simple code:

        ULong                   s_fromDate;
        DateType                dateType;
        DateTimeType    dateTimeType;

        MemSet(&dateTimeType,0,sizeof(DateTimeType));
        dateTimeType.year = dateType.year;
        dateTimeType.month = dateType.month;
        dateTimeType.day = dateType.day;

        s_fromDate = TimDateTimeToSeconds(&dateTimeType);

Basically I use a DateType because I want to use the function DateAdjust
and then I put the result into a DateTimeType so that I can get back the
seconds since 1904 (that is what I use in my database).

This code works fine on POSE but on a real Palm3 I was getting back the
strangest dates. I traced this down to the fact that MemSet was not setting
all my DateTimeType fields to 0 and therefore TimDateTimeToSeconds was
returning the strangest values. If instead of doing the MemSet I manually
set all fields to 0, it works fine.

Any ideas?

Chris

---
Christian Vandendorpe ([EMAIL PROTECTED])
http://www.zorglub.com

Reply via email to