aboutsummaryrefslogtreecommitdiffstats
path: root/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'env.c')
-rw-r--r--env.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/env.c b/env.c
index ee6359c4..69996683 100644
--- a/env.c
+++ b/env.c
@@ -116,14 +116,15 @@ char *rfc822timestamp(void)
time(&now);
#ifdef HAVE_STRFTIME
/*
- * Conform to RFC822. Note that we generate a 4-digit year here,
- * avoiding Y2K hassles. Note: max length of this timestamp in an
- * English locale should be 32 chars, assuming a 5-character timezone
- * of the form [+-]nnnn. The only things that should vary by locale
+ * Conform to RFC822. GMT rather than local time because of the
+ * mess that %Z generates obsolete 822 syntax but %z is not
+ * guaranteed portable. We generate a 4-digit year here, avoiding
+ * Y2K hassles. Max length of this timestamp in an English locale
+ * should be 29 chars. The only things that should vary by locale
* are the day and month abbreviations.
*/
strftime(buf, sizeof(buf)-1,
- "%a, %d %b %Y %H:%M:%S %z", localtime(&now));
+ "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
#else
/*
* This is really just a portability fallback, as the