Time handling

Time handling — [DEPRECATED] Helper functions to convert between Epoch time and Mac (iPod) time

Synopsis




time_t              itdb_time_get_mac_time              (void);
time_t              itdb_time_mac_to_host               (time_t time);
time_t              itdb_time_host_to_mac               (time_t time);

Description

The functions provide conversion between Epoch time and Mac (iPod) time.

Note

These functions are now obsolete and should no longer be used, libgpod automatically converts to/from Epoch time and iPod time when writing/reading the iPod databases.

Details

itdb_time_get_mac_time ()

time_t              itdb_time_get_mac_time              (void);

Warning

itdb_time_get_mac_time is deprecated and should not be used in newly-written code. kept for compatibility with older code, directly use g_get_current_time() or time(NULL) instead

Gets the current time in a format appropriate for storing in the libgpod data structures

Returns :

current time

itdb_time_mac_to_host ()

time_t              itdb_time_mac_to_host               (time_t time);

Warning

itdb_time_mac_to_host is deprecated and should not be used in newly-written code. It's been kept for compatibility with older code, but this function is now a no-op

Converts a timestamp from libgpod format to host system timestamp.

time :

time expressed in libgpod format

Returns :

timestamp for the host system

itdb_time_host_to_mac ()

time_t              itdb_time_host_to_mac               (time_t time);

Warning

itdb_time_host_to_mac is deprecated and should not be used in newly-written code. It's been kept for compatibility with older code, but this function is now a no-op

Convert host system timestamp to libgpod format timestamp

time :

time expressed in host unit

Returns :

a libgpod timestamp