diff --git a/src/os/inc/osTime.h b/src/os/inc/osTime.h index 52e6c376a6c240d8c10b8596effa8b398e1e61c4..1fb21ff38b2a29a3884b88c184530d3bac6a9c74 100644 --- a/src/os/inc/osTime.h +++ b/src/os/inc/osTime.h @@ -77,6 +77,15 @@ static FORCE_INLINE int64_t taosGetTimestamp(int32_t precision) { } } +//@return timestamp of today at 00:00:00 in seconds +static FORCE_INLINE int64_t taosGetTimestampToday() { + time_t t = time(NULL); + struct tm * tm= localtime(&t); + tm->tm_hour = 0; + tm->tm_min = 0; + tm->tm_sec = 0; + return (int64_t)mktime(tm); +} typedef struct SInterval { int32_t tz; // query client timezone