Add two constant varibles in rules expression

Add two variables:
- UtcTime
The number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT)
- LocalTime
Seconds passed after Jan 1, 1970 midnight base on current timezone and daylight saving setting.
This commit is contained in:
Laurent 2019-02-18 16:17:32 -05:00
parent 2bc84a9aad
commit 6f2f0b6fea
2 changed files with 9 additions and 0 deletions

View File

@ -331,6 +331,11 @@ uint32_t LocalTime(void)
return local_time;
}
uint32_t UtcTime(void)
{
return utc_time;
}
uint32_t Midnight(void)
{
return midnight;

View File

@ -651,6 +651,10 @@ bool findNextVariableValue(char * &pVarname, double &value)
value = GetMinutesPastMidnight();
} else if (sVarName.equals(F("UPTIME"))) {
value = GetMinutesUptime();
} else if (sVarName.equals(F("UTCTIME"))) {
value = UtcTime();
} else if (sVarName.equals(F("LOCALTIME"))) {
value = LocalTime();
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
} else if (sVarName.equals(F("SUNRISE"))) {
value = GetSunMinutes(0);