1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
Otto Winter
2019-05-08 14:56:54 +02:00
parent 95428b4cfe
commit 3fe9c20188
8 changed files with 11 additions and 31 deletions

View File

@@ -100,19 +100,13 @@ class RealTimeClock : public Component {
std::string get_timezone() { return this->timezone_; }
/// Get the time in the currently defined timezone.
ESPTime now() {
return ESPTime::from_epoch_utc(this->timestamp_now());
}
ESPTime now() { return ESPTime::from_epoch_utc(this->timestamp_now()); }
/// Get the time without any time zone or DST corrections.
ESPTime utcnow() {
return ESPTime::from_epoch_local(this->timestamp_now());
}
ESPTime utcnow() { return ESPTime::from_epoch_local(this->timestamp_now()); }
/// Get the current time as the UTC epoch since January 1st 1970.
time_t timestamp_now() {
return ::time(nullptr);
}
time_t timestamp_now() { return ::time(nullptr); }
void call_setup() override;