提交 1ae6cb7d 编写于 作者: A Anton Schubert 提交者: Martin Storsjö

dashenc: fix ISO8601 UTC parsing

Appends Z to timestamp to force ISO8601 datetime parsing as UTC.
Without Z, some browsers (Chrome) interpret the timestamp as
localtime and others (Firefox) interpret it as UTC.
Signed-off-by: NAnton Schubert <ischluff@mailbox.org>
Signed-off-by: NMartin Storsjö <martin@martin.st>
上级 2bbb5abd
......@@ -429,7 +429,7 @@ static void format_date_now(char *buf, int size)
struct tm *ptm, tmbuf;
ptm = gmtime_r(&t, &tmbuf);
if (ptm) {
if (!strftime(buf, size, "%Y-%m-%dT%H:%M:%S", ptm))
if (!strftime(buf, size, "%Y-%m-%dT%H:%M:%SZ", ptm))
buf[0] = '\0';
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册