We get snapshot times in GMT time, but need to convert them to DCE time (SMB time format) without changing the time zone. -- Thanks, Steve
From 64a2ba46f67c89356917cacde12443d0fa7901f6 Mon Sep 17 00:00:00 2001 From: Steve French <stfrench@xxxxxxxxxxxxx> Date: Tue, 2 Apr 2019 18:20:07 -0500 Subject: [PATCH] smbinfo: snapshots are returned in gmt time so don't convert timezone We display snapshot times in GMT time, but need to convert them to DCE time (SMB time format) without changing the time zone. Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> --- smbinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smbinfo.c b/smbinfo.c index d7a6431..c00f89b 100644 --- a/smbinfo.c +++ b/smbinfo.c @@ -1009,7 +1009,7 @@ static void print_snapshots(struct smb_snapshot_array *psnap) unsigned long long dce_time; j = 0; strptime(gmt_token, GMT_FORMAT, &tm); - dce_time = mktime(&tm) * 10000000 + NTFS_TIME_OFFSET; + dce_time = timegm(&tm) * 10000000 + NTFS_TIME_OFFSET; printf("\n SMB3:%lld ", dce_time); } } -- 2.17.1