aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index c9e574fbfd..7957751049 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -29,6 +29,17 @@ time_from_isodate (char *str)
return mktime (&my_tm);
}
+char *
+isodate_from_time_t (time_t t)
+{
+ struct tm *tm;
+ static char isotime [40];
+
+ tm = localtime (&t);
+ strftime (isotime, sizeof (isotime)-1, "%Y%m%dT%H%M%sZ", tm);
+ return &isotime;
+}
+
time_t
time_from_start_duration (time_t start, char *duration)
{