Modify

Opened 6 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:

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 Changed 6 years ago by TicketCleanup

  • Version 3.3.14.5 deleted

Automatic ticket cleanup.

comment:2 Changed 4 years ago by Jpm

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

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

Version 0, edited 4 years ago by Jpm (next)

comment:3 Changed 3 years ago by Jpm

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

included in 3.3.15.4

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 closed The owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.