SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
timestring.cpp
Go to the documentation of this file.
1
2#include "timestring.h"
3
4namespace sensesp {
5
6TimeString::TimeString(const String& config_path)
7 : Transform<time_t, String>(config_path) {}
8
9void TimeString::set(const time_t& input) {
10 char buf[sizeof "2011-10-08T07:07:09Z"];
11 strftime(buf, sizeof buf, "%FT%TZ", gmtime(&input));
12 this->emit(String(buf));
13}
14
15} // namespace sensesp
virtual void set(const time_t &input) override
Definition timestring.cpp:9
TimeString(const String &config_path="")
Definition timestring.cpp:6
The main Transform class. A transform is identified primarily by the type of value that is produces (...
Definition transform.h:53
void emit(const String &new_value)