6

Is it possible to view the last time a file was modified in Windows command prompt in milliseconds or even in seconds?

| improve this question | |
7

There is no native Windows command line utility that supports viewing time stamps with a resolution of milliseconds.

Your best option would to either use a 3rd party tool or for a native solution (Vista+), use robocopy (supports seconds):

robocopy /L /TS . ..

Tracking a resolution finer than seconds might be trivial or useless as well depending on the file system being used. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx and http://jpsoft.com/help/index.htm?timestamps.htm

FAT has a write time resolution of 2 seconds.

| improve this answer | |
7

The robocopy answer does work, but another nice option that works from the standard Windows console (not DOS per se):

forfiles /c "cmd /c echo @file @ftime"

| improve this answer | |
0

Another user wrote "There is no native Windows command line utility that supports viewing time stamps with a resolution of milliseconds." That is incorrect. Run either of the two wmic commands on a file in an NTFS filesystem and you will see the timestamp to the accuracy of millionths of a second (microsecond which is shorter/smaller than millisecond):

For file type = file:

G:\>wmic datafile where Name="G:\\c\\m\\d\\file.jpg" list /format:list
AccessMask=2032127
Archive=TRUE
Caption=g:\c\m\d\file.jpg
Compressed=FALSE
CompressionMethod=
CreationClassName=CIM_LogicalFile
CreationDate=20141109222121.770365-420
CSCreationClassName=Win32_ComputerSystem
CSName=LENOVO
Description=g:\c\m\d\file.jpg
Drive=g:
EightDotThreeFileName=g:\c\m\d\file.jpg
Encrypted=FALSE
EncryptionMethod=
Extension=jpg
FileName=file
FileSize=737719
FileType=JPEG Image
FSCreationClassName=Win32_FileSystem
FSName=NTFS
Hidden=FALSE
InstallDate=20141109222121.770365-420
InUseCount=
LastAccessed=20200909172756.711862-360
LastModified=20140817192345.000000-360
Manufacturer=
Name=g:\c\m\d\file.jpg
Path=\c\m\d\
Readable=TRUE
Status=OK
System=FALSE
Version=
Writeable=TRUE

For file type = file folder / directory:

E:\>wmic FSDIR where Name="D:\\a\\b\\c\\folder" list /format:list
AccessMask=2032127
Archive=TRUE
Compressed=FALSE
CompressionMethod=
CSName=RPM-HP14-BW012N
Description=d:\a\b\c\folder
Drive=d:
EightDotThreeFileName=d:\a\b\c\folder
Encrypted=FALSE
EncryptionMethod=
Extension=
FileName=folder
FileSize=
FileType=File Folder
FSName=NTFS
Hidden=FALSE
InstallDate=20141109221702.051899-420
InUseCount=
LastAccessed=20200921013720.883985-420
LastModified=20200919161912.763540-420
Name=d:\a\b\c\folder
Path=\a\b\c\
Readable=TRUE
Status=OK
System=FALSE
Writeable=TRUE

20141109222121.770365-420 = 2014-11-09 22 hours 21 minutes 21 seconds 770365 microseconds 420 minutes different from UTC time.

10 millionths of seconds: See https://superuser.com/questions/937380/get-creation-time-of-file-in-milliseconds which has text generated by a different method - "[File] Birth [time]: 2015-03-29 22:16:50.080654200 +0100". "080654200" shows the amount of nanoseconds (080,654,200) or the amount of tenths of microseconds (0,806,542).

Wikipedia says: NTFS Date resolution = 100 ns - https://en.wikipedia.org/wiki/NTFS

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.