added TimeZone(time_t xxx, timezone);

Usage:  
time_t localtime;
localtime = TimeZone(UnixTime, 8);   // Beijing timezone = 8
This commit is contained in:
csnol 2017-09-13 10:53:08 +08:00 committed by GitHub
parent a87ad87fa7
commit 30f8527eaa
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ class RTClock {
uint8_t second(time_t t) { breakTime(t, tmm); return tmm.second; }
uint8_t isPM(time_t t) { return (hour(t)>=12); }
time_t TimeZone(time_t t, uint8_t TZ) { return ( t - (TZ * SECS_PER_HOUR)); } // usage: localtime = TimeZone(UnixTime, 8); // Beijing timezone = 8
void createAlarm(voidFuncPtr function, time_t alarm_time_t);
void createAlarm(voidFuncPtr function, struct tm_t & alarm_tm);