From a82410a3c20ba13969f37d3ab14f6e8ca1067284 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 23 Apr 2025 13:47:43 +0300 Subject: common code went to the core utils --- include/m_utils.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/m_utils.h') diff --git a/include/m_utils.h b/include/m_utils.h index d7dc704085..3ce8b68de3 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -434,6 +434,17 @@ EXTERN_C MIR_CORE_DLL(void) Utils_GetRandom(void *pszDest, size_t cbLen); EXTERN_C MIR_CORE_DLL(bool) Utils_IsRtl(const wchar_t *pszwText); +///////////////////////////////////////////////////////////////////////////////////////// +// Converts a timestamp in the ISO format to time_t + +EXTERN_C MIR_CORE_DLL(time_t) Utils_IsoToUnixTime(const char *pszIsoTimestamp); + +#ifdef _XSTRING_ +__forceinline time_t Utils_IsoToUnixTime(const std::string &str) { + return Utils_IsoToUnixTime(str.c_str()); +} +#endif + ///////////////////////////////////////////////////////////////////////////////////////// // UUID generator -- cgit v1.2.3