src/graph_config.c: Use the correct config file …
[collection4.git] / src / utils_params.c
index dbe085d..5b63334 100644 (file)
@@ -275,10 +275,13 @@ int time_to_rfc1123 (time_t t, char *buffer, size_t buffer_size) /* {{{ */
   struct tm tm_tmp;
   size_t status;
 
-  if (localtime_r (&t, &tm_tmp) == NULL)
+  /* RFC 1123 *requires* the time to be GMT and the "GMT" timezone string.
+   * Apache will ignore the timezone if "localtime_r" and "%z" is used,
+   * resulting in weird behavior. */
+  if (gmtime_r (&t, &tm_tmp) == NULL)
     return (errno);
 
-  status = strftime (buffer, buffer_size, "%a, %d %b %Y %T %z", &tm_tmp);
+  status = strftime (buffer, buffer_size, "%a, %d %b %Y %T GMT", &tm_tmp);
   if (status == 0)
     return (errno);