aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c20
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)
{
d=87f4d471fb27b9547c1a0de221b51f4c31684157'>- Welcome X.org 7.2 \o/.flz2007-05-202-1/+1 * - Add mastersite.jmelo2007-04-041-1/+2 * - Update to 0.11.1miwi2007-02-273-5/+32 * - Fix startup crashmiwi2007-02-137-86/+832 * - Update to 0.11miwi2007-02-093-666/+235 * - Return to ports@, at maintainer's request.shaun2006-12-141-1/+2 * - Update to 0.10.1pav2006-06-114-129/+128 * - Rename portspav2006-05-281-1/+1 * fix file-transfer connection problems, patch by Dimitur Kirovarved2006-05-222-0/+42 * - Update to 0.10pav2006-05-074-338/+495 * Reset vsevolod as maintainer due to unreponsiveness. We hope to see himlinimon2006-04-151-1/+1 * - Update to 0.9.1vsevolod2006-01-294-18/+132 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-221-1/+1 * Move instant messaging related ports to newly created net-im category:pav2005-11-091-1/+1 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-0/+1 * Update to 0.8.2 that contains tons of bugfixes.vsevolod2005-09-144-44/+43 * Update to 0.8.vsevolod2005-08-283-142/+275 * Update my email address.vsevolod2005-07-221-1/+1 * Directory share/pixmaps is now included in mtreelesi2005-06-151-1/+0 * - Update to 0.7.1 [1]jylefort2005-06-074-82/+64 * - Fix pkg-plistsem2005-06-022-0/+2 * - Update to 0.7sem2005-05-318-221/+276 * - Fix glib search pathsem2005-05-061-2/+2