diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-18 13:25:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-18 13:25:18 +0000 |
commit | c1c7b9c63d6d2cdf5c42443b7a9c8c80bae49162 (patch) | |
tree | 3073b33a1ada2e6acf365b89f0a221f4e5c194f4 /src/libutil/util.h | |
parent | 0a4520a368036e9d02f7f3b2f6560c49cfa2741b (diff) | |
download | rspamd-c1c7b9c63d6d2cdf5c42443b7a9c8c80bae49162.tar.gz rspamd-c1c7b9c63d6d2cdf5c42443b7a9c8c80bae49162.zip |
[Minor] Add own localtime/gmtime implementations
Diffstat (limited to 'src/libutil/util.h')
-rw-r--r-- | src/libutil/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libutil/util.h b/src/libutil/util.h index adb645600..03399fec3 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -474,6 +474,20 @@ gdouble rspamd_normalize_probability (gdouble x, gdouble bias); */ guint64 rspamd_tm_to_time (const struct tm *tm, glong tz); +/** + * Splits unix timestamp into struct tm using GMT timezone + * @param ts + * @param dest + */ +void rspamd_gmtime (guint64 ts, struct tm *dest); + +/** + * Split unix timestamp into struct tm using local timezone + * @param ts + * @param dest + */ +void rspamd_localtime (guint64 ts, struct tm *dest); + #define PTR_ARRAY_FOREACH(ar, i, cur) for ((i) = 0; (ar) != NULL && (i) < (ar)->len && (((cur) = g_ptr_array_index((ar), (i))) || 1); ++(i)) /** |