Modify

Opened 7 years ago

Closed 5 years ago

#3662 closed Feature Request (Fixed)

Additional Parameter for FileGetTime() to return the milliseconds as well

Reported by: rudi Owned by: J-Paul Mesnage
Milestone: Component: AutoIt
Version: Severity: None
Keywords: FileGetTime, ms, milliseconds Cc:

Description

Fact:
NTFS has very accurate file timestamp information, but FileGetTime() only returns down to a granularity of seconds.

Feature Request:

FileGetTime ( "filename" [, option = 0 [, format = 0 [, ms = 0] ] ] )

My QND approach, slightly modified from date.au3:

#include <Date.au3>

$file = "c:\temp\test.txt" ; file must already exist

$TSLastModMs = GetFileLastModWithMs($file)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $TSLastModMs = ' & $TSLastModMs & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

Func GetFileLastModWithMs($_FullFilePathName)

$h = _WinAPI_CreateFile($_FullFilePathName, 2, 2)
$aTS = _Date_Time_GetFileTime($h)
_WinAPI_CloseHandle($h)
$aDate = _Date_Time_FileTimeToArray($aTS[2])
Return StringFormat("%04d-%02d-%02d %02d:%02d:%02d.%03d", $aDate[2], $aDate[0], $aDate[1], $aDate[3], $aDate[4], $aDate[5], $aDate[6])

EndFunc ;==>GetFileLastModWithMs

Attachments (0)

Change History (3)

comment:1 by TicketCleanup, 7 years ago

Version: 3.3.14.5

Automatic ticket cleanup.

comment:2 by J-Paul Mesnage, 5 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

Hi,
Sent to Jon no additional par but $FT_MSEC in format can be added

Last edited 5 years ago by J-Paul Mesnage (previous) (diff)

comment:3 by J-Paul Mesnage, 5 years ago

Resolution: Fixed
Status: assignedclosed

included in 3.3.15.4

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.