From: Eric Biggers Date: Tue, 28 Aug 2012 22:30:50 +0000 (-0500) Subject: Timestamp printing UTC X-Git-Tag: v1.0.0~53 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=72f16c2c9e53f83210e8679f487d4a64d8c897e7 Timestamp printing UTC --- diff --git a/src/dentry.c b/src/dentry.c index 4d3fc682..8a285e25 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -479,6 +479,8 @@ int print_dentry(struct dentry *dentry, void *lookup_table) { const u8 *hash; struct lookup_table_entry *lte; + time_t time; + char *p; printf("[DENTRY]\n"); printf("Length = %"PRIu64"\n", dentry->length); @@ -503,9 +505,21 @@ int print_dentry(struct dentry *dentry, void *lookup_table) time_t creat_time = wim_timestamp_to_unix(dentry->creation_time); time_t access_time = wim_timestamp_to_unix(dentry->last_access_time); time_t mod_time = wim_timestamp_to_unix(dentry->last_write_time); - printf("Creation Time = %s", asctime(gmtime(&creat_time))); - printf("Last Access Time = %s", asctime(gmtime(&access_time))); - printf("Last Write Time = %s", asctime(gmtime(&mod_time))); + + time = wim_timestamp_to_unix(dentry->creation_time); + p = asctime(gmtime(&time)); + *(strrchr(p, '\n')) = '\0'; + printf("Creation Time = %s UTC\n", p); + + time = wim_timestamp_to_unix(dentry->last_access_time); + p = asctime(gmtime(&time)); + *(strrchr(p, '\n')) = '\0'; + printf("Last Access Time = %s UTC\n", p); + + time = wim_timestamp_to_unix(dentry->last_write_time); + p = asctime(gmtime(&time)); + *(strrchr(p, '\n')) = '\0'; + printf("Last Write Time = %s UTC\n", p); printf("Reparse Tag = 0x%"PRIx32"\n", dentry->reparse_tag); printf("Hard Link Group = 0x%"PRIx64"\n", dentry->hard_link); diff --git a/src/xml.c b/src/xml.c index 0de179c4..943fb834 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1035,14 +1035,15 @@ void print_image_info(const struct wim_info *wim_info, int image) uint i; const struct image_info *image_info; const char *desc; - time_t ctime; - time_t mtime; if (image == WIM_ALL_IMAGES) { for (i = 1; i <= wim_info->num_images; i++) print_image_info(wim_info, i); } else { + time_t time; + char *p; + image_info = &wim_info->images[image - 1]; printf("Index: %"PRIu64"\n", @@ -1075,11 +1076,17 @@ void print_image_info(const struct wim_info *wim_info, int image) printf("Hard Link Bytes: %"PRIu64"\n", image_info->hard_link_bytes); - ctime = wim_timestamp_to_unix(image_info->creation_time); - mtime = wim_timestamp_to_unix(image_info->last_modification_time); + time = wim_timestamp_to_unix(image_info->creation_time); + p = asctime(gmtime(&time)); + *(strrchr(p, '\n')) = '\0'; + + printf("Creation Time: %s UTC\n", p); + + time = wim_timestamp_to_unix(image_info->last_modification_time); + p = asctime(gmtime(&time)); + *(strrchr(p, '\n')) = '\0'; - printf("Creation Time: %s", asctime(localtime(&ctime))); - printf("Last Modification Time: %s", asctime(localtime(&mtime))); + printf("Last Modification Time: %s UTC\n", p); if (image_info->windows_info_exists) print_windows_info(&image_info->windows_info); if (image_info->flags)