blob: ab39b1f27212f88cf2bb2c91d3f091c69b78760b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/*
* Compile with:
* gcc $(pkg-config --cflags --libs libgpod-1.0) -o tz ./get-timezone.c
*
* then run:
* ./tz <ipod-mountpoint>
*
* This should output something like:
* Timezone: UTC+1 DST
*
* which means I'm living in an UTC+1 timezone with DST which adds a 1 hour
* shift, ie my local time is UTC+2. DST won't be shown if not active.
*
*/
#include <errno.h>
#include <stdio.h>
#include <itdb.h>
#include <itdb_device.h>
int main (int argc, char **argv)
{
char *mountpoint;
Itdb_Device *device;
if (argc >= 2) {
mountpoint = argv[1];
} else {
g_print ("Usage: %s <mountpoint>\n\n", g_basename(argv[0]));
return -1;
}
device = itdb_device_new ();
itdb_device_set_mountpoint (device, mountpoint);
g_print ("Timezone: UTC%+d\n", device->timezone_shift/3600);
return 0;
}
|