diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-03 12:53:51 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-03 12:53:51 +0800 |
commit | dc90ad6b4302059c79a95d535c8363829faed7df (patch) | |
tree | 16d6a6f39048e3e01a8b63de62659230e3924a77 /calendar/timeutil.c | |
parent | 01b4ff7532756f9202336e59d2f1e401e758fcf9 (diff) | |
download | gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.gz gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.bz2 gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.lz gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.xz gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.zst gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.zip |
More calendar work -mig
svn path=/trunk/; revision=98
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r-- | calendar/timeutil.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c index 7d39ea9814..b860c84b09 100644 --- a/calendar/timeutil.c +++ b/calendar/timeutil.c @@ -20,7 +20,7 @@ time_from_isodate (char *str) my_tm.tm_year = (digit_at (str, 0) * 1000 + digit_at (str, 1) * 100 + digit_at (str, 2) * 10 + digit_at (str, 3)) - 1900; - my_tm.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5); + my_tm.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5) - 1; my_tm.tm_mday = digit_at (str, 6) * 10 + digit_at (str, 7); my_tm.tm_hour = digit_at (str, 9) * 10 + digit_at (str, 10); my_tm.tm_min = digit_at (str, 11) * 10 + digit_at (str, 12); @@ -28,16 +28,20 @@ time_from_isodate (char *str) my_tm.tm_isdst = -1; t = mktime (&my_tm); - { - struct tm *tm = localtime (&t); - - printf ("TIEMPO: %d/%d/%d %d:%d:%d\n", - tm->tm_mday, tm->tm_mon, tm->tm_year, - tm->tm_hour, tm->tm_min, tm->tm_sec); - } return t; } +void +print_time_t (time_t t) +{ + struct tm *tm = localtime (&t); + + printf ("TIEMPO: %d/%d/%d %d:%d:%d\n", + tm->tm_mday, tm->tm_mon, tm->tm_year, + tm->tm_hour, tm->tm_min, tm->tm_sec); +} + + char * isodate_from_time_t (time_t t) { |