/* * Author: Chris Lord * * Copyright (c) 2007 OpenedHand Ltd - http://www.openedhand.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include #include /* List ical time-zones. Compile with: * gcc -o lstz lstz.c `pkg-config --cflags --libs glib-2.0 libecal-1.2` -Wall */ int main (int argc, char **argv) { gint i; icaltimetype today = icaltime_today (); icalarray *builtin = icaltimezone_get_builtin_timezones (); for (i = 0; i < builtin->num_elements; i++) { icaltimezone *zone = (icaltimezone *)icalarray_element_at ( builtin, i); gchar *zone_tz; gdouble offset = ((gdouble)icaltimezone_get_utc_offset ( zone, &today, NULL)/60.0)/60.0; zone_tz = icaltimezone_get_tznames (zone); g_print ("%s (%s, +%lf)\n", icaltimezone_get_display_name (zone), icaltimezone_get_tznames (zone), offset); } return 0; }