]> wimlib.net Git - wimlib/blobdiff - src/timestamp.h
Test suite
[wimlib] / src / timestamp.h
index 819047d45e3648b392ff0afd5a2e8f1a1d2c0679..5ad0b3556343a937e5bb76587af97a6c5913f779 100644 (file)
 #define intervals_1601_to_1970 (years_1601_to_1970 * intervals_per_year \
                                + leap_years_1601_to_1970 * intervals_per_day)
 
+static inline u64 unix_timestamp_to_ms(time_t t)
+{
+       return (u64)intervals_1601_to_1970 + t * intervals_per_second;
+}
 /* 
  * Returns the number of 100-nanosecond intervals that have elapsed since
  * 12:00 A.M., January 1, 1601 UTC.
  */
 static inline u64 get_timestamp()
 {
-       return (u64)intervals_1601_to_1970 + (u64)time(NULL) * intervals_per_second;
+       return unix_timestamp_to_ms(time(NULL));
 }
 
 /* Converts a timestamp as used in the WIM file to a UNIX timestamp as used in