2025-03-19 17:27:04 +01:00
|
|
|
|
```
|
|
|
|
|
#include <time.h>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
morph_unixtime_to_iso ()
|
2025-03-20 16:28:16 +01:00
|
|
|
|
TimePoint ~ <TimeSince UnixEpoch> ~ Duration ~ Seconds ~ ℝ ~ <QuantizedLinear 0 1 1> ~ ℕ ~ native.UInt64
|
|
|
|
|
--> TimePoint ~ ISO8601 ~ <Seq~<ValueTerminated 0> Char~Ascii~native.UInt8>
|
2025-03-19 17:27:04 +01:00
|
|
|
|
```
|
|
|
|
|
time_t rawtime = (time_t)(*src);
|
|
|
|
|
struct tm *timeinfo = gmtime(&rawtime);
|
|
|
|
|
if (!timeinfo) return -1;
|
|
|
|
|
|
|
|
|
|
strftime((char*)dst, 20, "%Y-%m-%dT%H:%M:%SZ", timeinfo);
|
|
|
|
|
return 0;
|
|
|
|
|
```
|