Added timepoint validator
This commit is contained in:
@ -338,3 +338,9 @@ float float_map(float x, float in_min, float in_max, float out_min, float out_ma
|
|||||||
|
|
||||||
return (delta * dividend + (divisor / 2.f)) / divisor + out_min;
|
return (delta * dividend + (divisor / 2.f)) / divisor + out_min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_valid_timestamp(espchrono::utc_clock::time_point timestamp)
|
||||||
|
{
|
||||||
|
using namespace date;
|
||||||
|
return timestamp.time_since_epoch() > sys_seconds{sys_days{1_d/January/2000}}.time_since_epoch();
|
||||||
|
}
|
||||||
|
@ -80,3 +80,4 @@ inline CRGB UINT32_TO_CRGB(uint32_t color)
|
|||||||
|
|
||||||
std::string get_wifi_security_string(wifi_auth_mode_t authMode);
|
std::string get_wifi_security_string(wifi_auth_mode_t authMode);
|
||||||
float float_map(float x, float in_min, float in_max, float out_min, float out_max);
|
float float_map(float x, float in_min, float in_max, float out_min, float out_max);
|
||||||
|
bool is_valid_timestamp(espchrono::utc_clock::time_point timestamp);
|
||||||
|
Reference in New Issue
Block a user