aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-12 07:32:49 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-12 07:32:49 +0800
commitb265b27dfc1e68424d509a17b9c6466adbae3fc9 (patch)
tree1e51ab8e242cdba68272961308da8be4ef1f628a /calendar/timeutil.c
parent5f869ecc19985407b08a29f03afbad7a37e1a43f (diff)
downloadgsoc2013-evolution-b265b27dfc1e68424d509a17b9c6466adbae3fc9.tar.gz
gsoc2013-evolution-b265b27dfc1e68424d509a17b9c6466adbae3fc9.tar.zst
gsoc2013-evolution-b265b27dfc1e68424d509a17b9c6466adbae3fc9.zip
More work on the recurrence dialog box, day navigation -mig
svn path=/trunk/; revision=126
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index acd2b33ee7..c19b394be9 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -117,3 +117,51 @@ time_add_year (time_t time, int years)
}
return new_time;
}
+
+time_t
+time_day_hour (time_t t, int hour)
+{
+ struct tm tm;
+ time_t retval;
+
+ tm = *localtime (&t);
+ tm.tm_hour = hour;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+
+ retval = mktime (&tm);
+ return retval;
+}
+
+
+time_t
+time_start_of_day (time_t t)
+{
+ struct tm tm;
+ time_t retval;
+
+ tm = *localtime (&t);
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+
+ retval = mktime (&tm);
+ return retval;
+}
+
+time_t
+time_end_of_day (time_t t)
+{
+ struct tm tm;
+ time_t retval;
+
+ tm = *localtime (&t);
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_mday++;
+
+ retval = mktime (&tm);
+ return retval;
+}
+