feat(Core/Common): add new helpers for time utility (#10207)

This commit is contained in:
Kargatum 2022-01-19 12:01:59 +07:00 committed by GitHub
parent b5ab409614
commit 259b9133f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 732 additions and 341 deletions

View file

@ -1890,11 +1890,8 @@ public:
{
case EVENT_TIME:
{
// Get how many times it should ring
time_t t = time(nullptr);
tm local_tm;
tzset(); // set timezone for localtime_r() -> fix issues due to daylight time
localtime_r(&t, &local_tm);
tm local_tm = Acore::Time::TimeBreakdown();
uint8 _rings = (local_tm.tm_hour) % 12;
_rings = (_rings == 0) ? 12 : _rings; // 00:00 and 12:00