Opened 5 years ago

Closed 3 years ago

#3662 closed Feature Request (Fixed)

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

Reported by: rudi Owned by: Jpm
Milestone: Component: AutoIt
Version: Severity: None
Keywords: FileGetTime, ms, milliseconds Cc:


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)
$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 Changed 5 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

comment:2 Changed 3 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

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

Last edited 3 years ago by Jpm (previous) (diff)

comment:3 Changed 3 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from assigned to closed

included in

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.