diff options
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r-- | calendar/timeutil.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c index 09123b3202..df72390bc8 100644 --- a/calendar/timeutil.c +++ b/calendar/timeutil.c @@ -104,6 +104,21 @@ time_add_day (time_t time, int days) } time_t +time_add_minutes (time_t time, int minutes) +{ + struct tm *tm = localtime (&time); + time_t new_time; + + tm->tm_min += minutes; + if ((new_time = mktime (tm)) == -1){ + g_warning ("mktime could not handling adding a day with\n"); + print_time_t (time); + return time; + } + return new_time; +} + +time_t time_add_year (time_t time, int years) { struct tm *tm = localtime (&time); |