summary refs log tree commit diff
path: root/html.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-13 12:43:56 -0400
committerJune McEnroe <june@causal.agency>2020-04-13 12:43:56 -0400
commitd031cf5f00de4bf6b33396f1a448833a6de33c5f (patch)
treeaa80e5cda92bfc2d3338f7020a8ab75ca1369cf5 /html.c
parentRework path functions again (diff)
downloadbubger-d031cf5f00de4bf6b33396f1a448833a6de33c5f.tar.gz
bubger-d031cf5f00de4bf6b33396f1a448833a6de33c5f.zip
Use UTC date everywhere
I thought I could preserve the original time zone but it turns out that
libc is just too shit to do that.
Diffstat (limited to '')
-rw-r--r--html.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/html.c b/html.c
index e92ab0a..808e799 100644
--- a/html.c
+++ b/html.c
@@ -89,10 +89,8 @@ int htmlMessageHead(FILE *file, const struct Envelope *envelope) {
 	);
 	char *mbox = templateURL("../message/[pathID].mbox", urlVars);
 
-	char date[256];
-	char utc[sizeof("0000-00-00T00:00:00Z")];
-	strftime(date, sizeof(date), "%c %z", &envelope->date);
-	strftime(utc, sizeof(utc), "%FT%TZ", gmtime(&envelope->utc));
+	char date[sizeof("0000-00-00T00:00:00Z")];
+	strftime(date, sizeof(date), "%FT%TZ", gmtime(&envelope->date));
 	struct Variable vars[] = {
 		{ "messageID", envelope->messageID },
 		{ "fragment", fragment },
@@ -100,7 +98,6 @@ int htmlMessageHead(FILE *file, const struct Envelope *envelope) {
 		{ "mailto", mailto },
 		{ "from", addressName(envelope->from) },
 		{ "date", date },
-		{ "utc", utc },
 		{ "mbox", mbox },
 		{0},
 	};
@@ -109,7 +106,7 @@ int htmlMessageHead(FILE *file, const struct Envelope *envelope) {
 		<summary>
 			<a class="subject" href="[fragment]">[subject]</a>
 			<address class="from"><a href="[mailto]">[from]</a></address>
-			<time datetime="[utc]">[date]</time>
+			<time datetime="[date]">[date]</time>
 			<a class="mbox" href="[mbox]">mbox</a>
 		</summary>
 	);