Closed mohs8421 closed 1 year ago
After some searching, I found a solution, which looks like this:
pub fn time() -> i64 {
let mut timer: time_t = 0;
unsafe {
esp_idf_sys::time(&mut timer);
}
timer as i64
}
This might be a nice small addition to the examples.
SysTime
from esp-idf-svc
.
I would like to sync the system clock and get unixtimestamps, but I am unsure how to do it.
I already found out, that I have to start with this:
but how do I access the correct time now?