aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index f23277ce37..c27a8dbd45 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -148,6 +148,19 @@ time_day_hour (time_t t, int hour)
time_t
+time_from_day (int year, int month, int day)
+{
+ struct tm tm;
+
+ memset (&tm, 0, sizeof (tm));
+ tm.tm_year = year - 1900;
+ tm.tm_mon = month;
+ tm.tm_mday = day;
+
+ return mktime (&tm);
+}
+
+time_t
time_start_of_day (time_t t)
{
struct tm tm;