diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-21 14:06:12 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-21 14:06:12 +0000 |
commit | be6fe2527a6f5e6b9ebe2f124bdcb2749d9f7997 (patch) | |
tree | b171cc375191501085a4660fc3eebf889a673ce4 /src/libutil/util.h | |
parent | c9cdf449078ce760c0528600370b35e3f26c2f08 (diff) | |
download | rspamd-be6fe2527a6f5e6b9ebe2f124bdcb2749d9f7997.tar.gz rspamd-be6fe2527a6f5e6b9ebe2f124bdcb2749d9f7997.zip |
[Feature] Add function to convert struct tm to time using timezone
Diffstat (limited to 'src/libutil/util.h')
-rw-r--r-- | src/libutil/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/util.h b/src/libutil/util.h index da10e419a..40144f7f7 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -12,6 +12,7 @@ #include <netdb.h> #endif #include <event.h> +#include <time.h> struct rspamd_config; struct rspamd_main; @@ -507,5 +508,13 @@ gpointer rspamd_shmem_xmap (const char *fname, guint mode, */ gdouble rspamd_normalize_probability (gdouble x, gdouble bias); +/** + * Converts struct tm to time_t + * @param tm + * @param tz timezone in format (hours * 100) + minutes + * @return + */ +guint64 rspamd_tm_to_time (const struct tm *tm, glong tz); + #define PTR_ARRAY_FOREACH(ar, i, cur) if (ar != NULL) for ((i) = 0, (cur) = g_ptr_array_index((ar), 0); (i) < (ar)->len; (cur) = g_ptr_array_index((ar), (i + 1)), ++(i)) #endif |