Defines | |
#define | CLOCKD_SERVICE "com.nokia.clockd" |
#define | CLOCKD_PATH "/com/nokia/clockd" |
#define | CLOCKD_INTERFACE "com.nokia.clockd" |
#define | CLOCKD_TIME_CHANGED "time_changed" |
Functions | |
int | time_get_synced (void) |
time_t | time_get_time (void) |
int | time_set_time (time_t tick) |
int | time_get_net_time (time_t *tick, char *s, size_t max) |
int | time_is_net_time_changed (time_t *tick, char *s, size_t max) |
int | time_activate_net_time (void) |
time_t | time_mktime (struct tm *tm, const char *tz) |
int | time_get_timezone (char *s, size_t max) |
int | time_get_tzname (char *s, size_t max) |
int | time_set_timezone (const char *tz) |
int | time_get_utc (struct tm *tm) |
int | time_get_utc_ex (time_t tick, struct tm *tm) |
int | time_get_local (struct tm *tm) |
int | time_get_local_ex (time_t tick, struct tm *tm) |
int | time_get_remote (time_t tick, const char *tz, struct tm *tm) |
int | time_get_default_timezone (char *s, size_t max) |
int | time_get_time_format (char *s, size_t max) |
int | time_set_time_format (const char *fmt) |
int | time_format_time (const struct tm *tm, const char *fmt, char *s, size_t max) |
int | time_get_utc_offset (const char *tz) |
int | time_get_dst_usage (time_t tick, const char *tz) |
double | time_diff (time_t t1, time_t t2) |
int | time_get_time_diff (time_t tick, const char *tz1, const char *tz2) |
int | time_set_autosync (int enable) |
int | time_get_autosync (void) |
int | time_is_operator_time_accessible (void) |
Link your application with -lrt
Copyright (C) 2008 Nokia. All rights reserved.
#define CLOCKD_SERVICE "com.nokia.clockd" |
CLOCKD_SERVICE: The name of the clockd D-Bus service.
Referenced by client_new_req(), and server_init().
#define CLOCKD_PATH "/com/nokia/clockd" |
CLOCKD_PATH: The D-Bus object path for the clockd daemon.
Referenced by client_new_req(), send_time_change_indication(), and server_filter().
#define CLOCKD_INTERFACE "com.nokia.clockd" |
CLOCKD_INTERFACE: The D-Bus interface the commands/signal use.
Referenced by client_new_req(), send_time_change_indication(), and server_filter().
#define CLOCKD_TIME_CHANGED "time_changed" |
D-Bus signal sent when time settings has been changed. Argument is int32 time. 0 means that time itself has not been changed (i.e timezone, for example, has changed).
Referenced by send_time_change_indication().
int time_get_synced | ( | void | ) |
Function to call when "time changed" indication (see osso_time_set_notification_cb) has been received by the application.
If the application does not wish to link with libosso, then it can listen to the CLOCKD_TIME_CHANGED D-Bus signal, that clockd sends also.
The time changed indication is broadcasted to all libtime users when:
time_t time_get_time | ( | void | ) |
Get current time - see time()
int time_set_time | ( | time_t | tick | ) |
Set current system and RTC time
tick | Time since Epoch |
int time_get_net_time | ( | time_t * | tick, | |
char * | s, | |||
size_t | max | |||
) |
Get the network time (in case that autosync is not enabled and a network time change indication has received)
tick | Supplied buffer to store network time (ticks since Epock) | |
s | Supplied buffer to store network timezone | |
max | Size of 's', including terminating NUL |
Referenced by time_is_net_time_changed().
int time_is_net_time_changed | ( | time_t * | tick, | |
char * | s, | |||
size_t | max | |||
) |
Deprecated, see time_get_net_time
int time_activate_net_time | ( | void | ) |
Set current system and RTC time according to operator network time in case time_is_net_time_changed() indicates change
time_t time_mktime | ( | struct tm * | tm, | |
const char * | tz | |||
) |
Make time_t from struct tm. Like mktime() but timezone can be given.
tm | See mktime | |
tz | Time zone variable. All formats that glibc supports can be given. NULL if current zone is used. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html |
int time_get_timezone | ( | char * | s, | |
size_t | max | |||
) |
Get current time zone. May return empty string if time zone has not been set.
Example output:
:US/Central
GMT+5:00GMT+4:00,0,365
The latter format is returned when network has indicated time zone change (the actual location is not known)
s | Supplied buffer to store timezone | |
max | Size of 's', including terminating NUL |
int time_get_tzname | ( | char * | s, | |
size_t | max | |||
) |
Get current time zone name (like "EET")
s | Supplied buffer to store tzname | |
max | Size of 's', including terminating NUL |
int time_set_timezone | ( | const char * | tz | ) |
Set current time zone ("TZ")
tz | Time zone variable. All formats that glibc supports can be given. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html It is, however recommended to use /usr/share/zoneinfo -method, for example: :Europe/Rome and not like this: EST+5EDT,M4.1.0/2,M10.5.0/2 |
int time_get_utc | ( | struct tm * | tm | ) |
Get current time in UTC. Inspired by time() and gmtime_r()
tm | Supplied buffer to store result |
int time_get_utc_ex | ( | time_t | tick, | |
struct tm * | tm | |||
) |
Get time in UTC.
tick | Time | |
tm | Supplied buffer to store result |
int time_get_local | ( | struct tm * | tm | ) |
Get current local time. Inspired by time() and localtime_r().
tm | Supplied buffer to store tm |
int time_get_local_ex | ( | time_t | tick, | |
struct tm * | tm | |||
) |
Get local time.
tick | Time | |
tm | Supplied buffer to store tm |
int time_get_remote | ( | time_t | tick, | |
const char * | tz, | |||
struct tm * | tm | |||
) |
Get local time in given zone. Inspired by setting TZ temporarily and localtime_r().
tick | Time since Epoch | |
tz | Time zone variable. All formats that glibc supports can be given. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html | |
tm | Supplied buffer to store tm |
int time_get_default_timezone | ( | char * | s, | |
size_t | max | |||
) |
Get the default time zone. Empty string is returned if no default zone has been defined.
s | Supplied buffer to store the zone | |
max | Size of 's', including terminating NUL |
int time_get_time_format | ( | char * | s, | |
size_t | max | |||
) |
Get current time string formatter. Inspired by strftime().
s | Supplied buffer to store formatter | |
max | Size of 's', including terminating NUL |
int time_set_time_format | ( | const char * | fmt | ) |
Set current time string formatter. Inspired by strftime().
fmt | Formatter string |
int time_format_time | ( | const struct tm * | tm, | |
const char * | fmt, | |||
char * | s, | |||
size_t | max | |||
) |
Format given time to string. Inspired by strftime() and localtime_r().
tm | Time | |
fmt | Formatter, see strftime and time_set_time_format and time_get_time_format, NULL if active formatter is used. | |
s | Supplied buffer to store result | |
max | Size of 's', including terminating NUL |
int time_get_utc_offset | ( | const char * | tz | ) |
Get utc offset (secs west of GMT) in the named TZ. The current daylight saving time offset is included.
tz | Time zone, all formats that glibc supports can be given. NULL to use current tz. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html |
int time_get_dst_usage | ( | time_t | tick, | |
const char * | tz | |||
) |
Return if daylight-saving-time is in use in given time.
tick | Time since Epoch | |
tz | Time zone, all formats that glibc supports can be given. NULL to use current tz. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html |
double time_diff | ( | time_t | t1, | |
time_t | t2 | |||
) |
See difftime()
int time_get_time_diff | ( | time_t | tick, | |
const char * | tz1, | |||
const char * | tz2 | |||
) |
Get time difference between two timezones
tick | Time since Epoch | |
tz1 | Timezone 1 | |
tz2 | Timezone 2 |
int time_set_autosync | ( | int | enable | ) |
Enable or disable automatic time settings based on cellular network time.
enable | Nonzero to enable, zero to disable |
int time_get_autosync | ( | void | ) |
Get the state of automatic time settings based on cellular network time.
int time_is_operator_time_accessible | ( | void | ) |
Get info if the device supports network time updates (i.e. has CellMo).