Modify

Opened 14 months ago

Last modified 14 months ago

#3662 new Feature Request

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

Reported by: rudi Owned by:
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 (1)

comment:1 Changed 14 months ago by TicketCleanup

  • Version 3.3.14.5 deleted

Automatic ticket cleanup.

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

Action
as new The ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.