Esempio n. 1
0
bool_t GetIsDst(datetime_t t)
{
    UInt32 ot = DateTimeToPalm(t);
    return TimUTCToTimeZone(ot, PrefGetPreference(prefTimeZone), 0) !=
           TimUTCToTimeZone(ot, PrefGetPreference(prefTimeZone),
                            PrefGetPreference(prefDaylightSavingAdjustment));
}
Esempio n. 2
0
struct tm *
localtime_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 = TimUTCToTimeZone (*pt + SEC_1904_1970, timeZone, daylightSavingAdjustment);
    palmtimet2unixtm (utcTime, ptm);
    return ptm;
}
Esempio n. 3
0
bool_t GetDatePacked(datetime_t t, datepack_t *tp, bool_t Local)
{
    DateTimeType Date;
    UInt32 ot;
    if (!tp || t == INVALID_DATETIME_T) return 0;
    memset(&Date, 0, sizeof(DateTimeType));

    ot = DateTimeToPalm(t);
    if (Local)
        ot = TimUTCToTimeZone(ot, PrefGetPreference(prefTimeZone),
                              PrefGetPreference(prefDaylightSavingAdjustment));

    TimSecondsToDateTime(ot, &Date);
    tp->Second = Date.second;
    tp->Minute = Date.minute;
    tp->Hour = Date.hour;
    tp->Day = Date.day;
    tp->Month = Date.month;
    tp->Year = Date.year;
    tp->WeekDay = Date.weekDay;
    return 1;
}