[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Time Zone trouble in P7110_GetNoteAlarmDiff() / nk7710.c
From: |
bertrand lesecq |
Subject: |
Time Zone trouble in P7110_GetNoteAlarmDiff() / nk7710.c |
Date: |
Thu, 05 Sep 2002 16:56:34 +0200 |
Hello
I am trying to convert my dtcm/Solaris appointment to Nokia 6210
Here is the content of P7110_GetNoteAlarmDiff() used to compute time diff
between CalendarNote.Time
and ClendarNote.Alarm
long P7110_GetNoteAlarmDiff(GSM_DateTime *time, GSM_DateTime *alarm)
{
time_t t_alarm;
time_t t_time;
struct tm tm_alarm;
struct tm tm_time;
tzset();
tm_alarm.tm_year = alarm->Year-1900;
tm_alarm.tm_mon = alarm->Month-1;
tm_alarm.tm_mday = alarm->Day;
tm_alarm.tm_hour = alarm->Hour;
tm_alarm.tm_min = alarm->Minute;
tm_alarm.tm_sec = alarm->Second;
tm_alarm.tm_isdst = 0;
t_alarm = mktime(&tm_alarm);
tm_time.tm_year = time->Year-1900;
tm_time.tm_mon = time->Month-1;
tm_time.tm_mday = time->Day;
tm_time.tm_hour = time->Hour;
tm_time.tm_min = time->Minute;
tm_time.tm_sec = time->Second;
tm_time.tm_isdst = 0;
t_time = mktime(&tm_time);
dprintf("\tAlarm: %02i-%02i-%04i %02i:%02i:%02i\n",
alarm->Day, alarm->Month, alarm->Year,
alarm->Hour, alarm->Minute, alarm->Second);
dprintf("\tDate: %02i-%02i-%04i %02i:%02i:%02i\n",
time->Day, time->Month, time->Year,
time->Hour, time->Minute, time->Second);
dprintf("Difference in alarm time is %f\n", difftime(t_time, t_alarm) +
3600);
return difftime(t_time, t_alarm) + 3600;
}
Why do we need to had 3600 / 1h to difftime() ??????
--
Cordialement / with kind regards
Bertrand Lesecq
```
(. .)
----------------o00-(_)-00o-------------------
Bertrand LESECQ
Sun EMEA Technical Support Group
/\ Development and User Interface
\\ \
\ \\ / French Solution Center
/ \/ / / Sun Service Inc.
/ / \//\ BP 53 -
\//\ / / 13 av. Morane Saulnier
/ / /\ / 78142 Velizy Cedex
/ \\ \
\ \\ Phone: +33 1.34.03.04.34 ( x30434 )
\/ Fax: +33 1.34.03.06.75
mailto:address@hidden
Solaris Freeware : http://www.sunfreeware.com/
Patch / FAQ : http://sunsolve.sun.fr
OnLine Documentaton : http://docs.sun.com
Sun System Handbook : http://sunsolve.sun.com/handbook_pub/
Solaris Developer Connection : http://soldc.sun.com
Newsgroup : comp.sys.sun
: comp.unix.solaris
-- Today is the first day of the rest of your life , take it easy --
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Time Zone trouble in P7110_GetNoteAlarmDiff() / nk7710.c,
bertrand lesecq <=