summary refs log tree commit diff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/html.c b/html.c
index 50a8378..3ebf9c3 100644
--- a/html.c
+++ b/html.c
@@ -35,6 +35,7 @@ static const char *Envelope = TEMPLATE(
 		<address>
 			<a href="[mailto]">[from]</a>
 		</address>
+		<time datetime="[utc]">[date]</time>
 	</summary>
 );
 
@@ -66,11 +67,19 @@ int htmlEnvelope(FILE *file, const struct Envelope *envelope) {
 	const char *from = envelope->from.name;
 	if (!from) from = envelope->from.mailbox;
 
+	char utc[sizeof("0000-00-00T00:00:00Z")];
+	strftime(utc, sizeof(utc), "%FT%TZ", gmtime(&envelope->utc));
+
+	char date[256];
+	strftime(date, sizeof(date), "%c %z", &envelope->date);
+
 	struct Variable vars[] = {
 		{ "messageID", envelope->messageID },
 		{ "subject", envelope->subject },
 		{ "mailto", mailto },
 		{ "from", from },
+		{ "utc", utc },
+		{ "date", date },
 		{0},
 	};
 	error = templateRender(file, Envelope, vars, escapeXML);