Beispiel #1
0
struct tm *
gmtime_r (const time_t *pt, struct tm *ptm)
{
    UInt32 utcTime;
    Int16 timeZone = PrefGetPreference(prefTimeZone);
    Int16 daylightSavingAdjustment = PrefGetPreference(prefDaylightSavingAdjustment);

    if ((NULL == pt) || (NULL == ptm)) {
        return NULL;
    }
    utcTime = TimTimeZoneToUTC (*pt + SEC_1904_1970, timeZone, daylightSavingAdjustment);
    palmtimet2unixtm (utcTime, ptm);
    return ptm;
}
Beispiel #2
0
datetime_t TimePackToRel(const datepack_t *tp, bool_t Local)
{
    DateTimeType Date;
    UInt32 ot;
    if (!tp) return INVALID_DATETIME_T;
    Date.second = (int16_t)tp->Second;
    Date.minute = (int16_t)tp->Minute;
    Date.hour = (int16_t)tp->Hour;
    Date.day = (int16_t)tp->Day;
    Date.month = (int16_t)tp->Month;
    Date.year = (int16_t)tp->Year;
    Date.weekDay = (int16_t)(tp->WeekDay-1);

    ot = TimDateTimeToSeconds(&Date);

    if (Local)
        ot = TimTimeZoneToUTC(ot, PrefGetPreference(prefTimeZone),
                              PrefGetPreference(prefDaylightSavingAdjustment));

    return PalmToDateTime(ot);
}