From 9c51cf4c9382ec7949cbce7b5d3babf8d5581e4d Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 22 Oct 1999 16:36:46 +0000 Subject: [PATCH] win32_utime() on directories should use localtime() rather than gmtime() (from Jan Dubois) p4raw-id: //depot/perl@4420 --- win32/win32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 4f0d7f8..1bfb6fe 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1296,14 +1296,13 @@ win32_times(struct tms *timebuf) return 0; } -/* fix utime() so it works on directories in NT - * thanks to Jan Dubois - */ +/* fix utime() so it works on directories in NT */ static BOOL filetime_from_time(PFILETIME pFileTime, time_t Time) { - struct tm *pTM = gmtime(&Time); + struct tm *pTM = localtime(&Time); SYSTEMTIME SystemTime; + FILETIME LocalTime; if (pTM == NULL) return FALSE; @@ -1316,7 +1315,8 @@ filetime_from_time(PFILETIME pFileTime, time_t Time) SystemTime.wSecond = pTM->tm_sec; SystemTime.wMilliseconds = 0; - return SystemTimeToFileTime(&SystemTime, pFileTime); + return SystemTimeToFileTime(&SystemTime, &LocalTime) && + LocalFileTimeToFileTime(&LocalTime, pFileTime); } DllExport int -- 1.8.3.1