Use gmtime not localtime when we want UTC, I got it right in one place
authornicm <nicm@openbsd.org>
Fri, 29 May 2015 15:58:01 +0000 (15:58 +0000)
committernicm <nicm@openbsd.org>
Fri, 29 May 2015 15:58:01 +0000 (15:58 +0000)
but not in another two. I expect I was confused by the fact that the
original file(1) had them the wrong way round (so, for example, leqldate
was actually UTC).

usr.bin/file/magic-test.c

index 35dbf10..dbc9fd2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: magic-test.c,v 1.5 2015/05/29 15:11:08 nicm Exp $ */
+/* $OpenBSD: magic-test.c,v 1.6 2015/05/29 15:58:01 nicm Exp $ */
 
 /*
  * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -603,7 +603,7 @@ magic_test_type_date(struct magic_line *ml, struct magic_state *ms)
                        ctime_r(&t, s);
                        break;
                default:
-                       asctime_r(localtime(&t), s);
+                       asctime_r(gmtime(&t), s);
                        break;
                }
                s[strcspn(s, "\n")] = '\0';
@@ -645,7 +645,7 @@ magic_test_type_qdate(struct magic_line *ml, struct magic_state *ms)
                        ctime_r(&t, s);
                        break;
                default:
-                       asctime_r(localtime(&t), s);
+                       asctime_r(gmtime(&t), s);
                        break;
                }
                s[strcspn(s, "\n")] = '\0';