#include <string.h>
#include <stdio.h>
#include "codec.h"
#include "logging.h"
Functions | |
int | decode_int (DBusMessageIter *iter, int *pval) |
int | decode_tm (DBusMessageIter *iter, struct tm *tm) |
int | decode_ctm (DBusMessageIter *iter, struct tm *tm) |
Copyright (C) 2008 Nokia. All rights reserved.
int decode_int | ( | DBusMessageIter * | iter, | |
int * | pval | |||
) |
Decode iteratively integer.
iter | DBusMessageIter | |
pval | Pointer to int to store the decoded integer |
int decode_tm | ( | DBusMessageIter * | iter, | |
struct tm * | tm | |||
) |
Decode struct tm
iter | DBusMessageIter | |
tm | Pointer to struct tm to store the decoded time |
int decode_ctm | ( | DBusMessageIter * | iter, | |
struct tm * | tm | |||
) |
Decode NET_TIME_IND to struct tm
The information may include the current date (day-month-year) and time (hour-minute-second) in UTC (Coordinated Universal Time), which is in practice same as GMT (Greenwich Mean Time).
Daylight Saving Time
Example 1:
if the time is 12:00:00 and time zone is GMT+2 hours and daylight saving time information is NET_DST_1_HOUR then the local time is 12:00:00 + 2 hours = 14:00:00. The Universal time is 12:00:00, the daylight saving is in use, so the normal time in that area would be 13:00:00.
Example 2:
if universal time information is missing, but time zone information indicates GMT - 10 hours, then the local time is 02:00:00 when universal time is 12:00:00.
Example 3:
if universal time information is missing and time zone information is missing, but daylight saving time information indicate NET_DST_1_HOUR then it can be known that daylight saving of 1 hour is used currently in the area and the current local time is +1 hours from the normal local time. However, if time zone is not known it is not possible to determine the local time. (The time zone might be known by some other means.)
See:
iter | DBusMessageIter | |
tm | Pointer to struct tm to store the decoded time. tm->tm_yday is the UTC offset in secs. |
Referenced by handle_csd_net_time_change().