summary refs log tree commit diff
path: root/archive.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--archive.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/archive.h b/archive.h
index 3328340..8576df5 100644
--- a/archive.h
+++ b/archive.h
@@ -172,6 +172,14 @@ void concatData(
 void concatThreads(struct List threads, const struct Envelope *envelopes);
 void concatIndex(struct List threads, const struct Envelope *envelopes);
 
+static inline struct ISO8601 {
+	char s[sizeof("0000-00-00T00:00:00Z")];
+} iso8601(time_t time) {
+	struct ISO8601 buf;
+	strftime(buf.s, sizeof(buf.s), "%FT%TZ", gmtime(&time));
+	return buf;
+}
+
 struct Variable {
 	const char *name;
 	const char *value;