add morphism for unix-timestamp to iso8601

This commit is contained in:
Michael Sippel 2025-03-19 17:27:04 +01:00
parent 8b8acb81a6
commit 24b332c682
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -0,0 +1,15 @@
```
#include <time.h>
```
morph_unixtime_to_iso ()
TimePoint ~ <TimeSince UnixEpoch> ~ Duration ~ Seconds ~ ~ <QuantizedLinear 0 1 1> ~ ~ x86.UInt64
--> TimePoint ~ ISO8601 ~ <Seq~<ValueTerminated 0> Char~Ascii~x86.UInt8>
```
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;
```