aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-31 00:45:16 +0200
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-31 00:45:16 +0200
commit7a828e39341202b595ef5f4213429041c844565d (patch)
tree23d53dc261db54d1c2d3a9fe4a07542c9fa105bf
parentget better more/thorough tests for the native wrapper (diff)
add ISO 8601 and "default" strftime prebaked formats
-rw-r--r--src/tm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tm.c b/src/tm.c
index a88ac36..9005626 100644
--- a/src/tm.c
+++ b/src/tm.c
@@ -280,6 +280,11 @@ struct strftime_format {
const char *format;
};
const static struct strftime_format strftime_formats[] = {
+ // ISO 8601 allows for a lot
+ // we represent it as YYYY-MM-DD hh:mm:ss[+/- offset]
+ // the main unfortunate bit is the use of +/-0000 over Z
+ {"iso8601", "%F %T%z"},
+ {"default", "%c"}, // system/locale format
{NULL, NULL},
};
JANET_FN(jd_strftime,