From 02118edb997112234798c4f3d3e978659e7a8836 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 17 Apr 2011 01:43:40 +0000 Subject: sbinfo: make the time calculation clearer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29732 a1c6a512-1295-4272-9138-f99709370657 --- utils/sbinfo/sbinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/sbinfo/sbinfo.c b/utils/sbinfo/sbinfo.c index f09bb79fe9..632c4b3eb9 100644 --- a/utils/sbinfo/sbinfo.c +++ b/utils/sbinfo/sbinfo.c @@ -386,7 +386,8 @@ static void extract(unsigned long filesize) uint64_t micros = sb_header->timestamp; time_t seconds = (micros / (uint64_t)1000000L); - seconds += 946684800; /* 2000/1/1 0:00:00 */ + struct tm tm_base = {0, 0, 0, 1, 0, 100, 0, 0, 1, 0, NULL}; /* 2000/1/1 0:00:00 */ + seconds += mktime(&tm_base); struct tm *time = gmtime(&seconds); color(GREEN); printf(" Creation date/time = "); -- cgit v1.2.3