Use correct epoch for creation/modification times
diff --git a/src/write.c b/src/write.c
index de80333..f676a2c 100644
--- a/src/write.c
+++ b/src/write.c
@@ -497,8 +497,11 @@
     // -----------------------------------------------------------------------
     // Begin write stream
 
-    avifImage * imageMetadata = encoder->data->imageMetadata;
-    uint64_t now = (uint64_t)time(NULL);
+    const avifImage * imageMetadata = encoder->data->imageMetadata;
+    // The epoch for creation_time and modification_time is midnight, Jan. 1,
+    // 1904, in UTC time. Add the number of seconds between that epoch and the
+    // Unix epoch.
+    uint64_t now = (uint64_t)time(NULL) + 2082844800;
 
     avifRWStream s;
     avifRWStreamStart(&s, output);