Skip to content

Commit 6be069c

Browse files
authored
change TZ from unit_8 to int, negatives timezone
usage: localtime = TimeZone(UnixTime, -7); // CA USA = -7
1 parent 30f8527 commit 6be069c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

STM32F1/libraries/RTClock/src/RTClock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class RTClock {
7272
uint8_t second(time_t t) { breakTime(t, tmm); return tmm.second; }
7373
uint8_t isPM(time_t t) { return (hour(t)>=12); }
7474

75-
time_t TimeZone(time_t t, uint8_t TZ) { return ( t - (TZ * SECS_PER_HOUR)); } // usage: localtime = TimeZone(UnixTime, 8); // Beijing timezone = 8
75+
time_t TimeZone(time_t t, int TZ) { return ( t - (TZ * SECS_PER_HOUR)); } // usage: localtime = TimeZone(UnixTime, 8); // Beijing timezone = 8
7676

7777
void createAlarm(voidFuncPtr function, time_t alarm_time_t);
7878
void createAlarm(voidFuncPtr function, struct tm_t & alarm_tm);

0 commit comments

Comments
 (0)