summaryrefslogtreecommitdiffstats
path: root/src/basic/time-util.h
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2015-10-13 21:14:33 +0200
committerHristo Venev <hristo@venev.name>2015-10-15 01:34:45 +0200
commit7c67c79c9abcaf39cff72ce0207b4c0f30ec5590 (patch)
tree2dc15257224fa0e9616559bcede6d9e63b78a8bc /src/basic/time-util.h
parentMerge pull request #1567 from teg/logind-suspend-logging (diff)
downloadsystemd-7c67c79c9abcaf39cff72ce0207b4c0f30ec5590.tar.xz
systemd-7c67c79c9abcaf39cff72ce0207b4c0f30ec5590.zip
basic: add mktime_or_timegm and localtime_or_gmtime_r
to time-util.h. They take an extra argument `bool utc`.
Diffstat (limited to 'src/basic/time-util.h')
-rw-r--r--src/basic/time-util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/time-util.h b/src/basic/time-util.h
index 1af01541fc..417376ea96 100644
--- a/src/basic/time-util.h
+++ b/src/basic/time-util.h
@@ -21,8 +21,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <inttypes.h>
+#include <stdio.h>
+#include <time.h>
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
@@ -117,3 +118,6 @@ clockid_t clock_boottime_or_monotonic(void);
"xstrftime: " #buf "[] must be big enough")
int get_timezone(char **timezone);
+
+time_t mktime_or_timegm(struct tm *tm, bool utc);
+struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc);