Skip to main content
VIKEHAN
New Participant
January 6, 2019
Answered

How to get file's last modified date with script?

  • January 6, 2019
  • 1 reply
  • 5228 views

How to get file's last modified date with script?

This topic has been closed for replies.
Correct answer Tomas Sinkunas

Sure

alert(myFile.modified.getTime());

1 reply

Tomas Sinkunas
Brainiac
January 6, 2019

File object has a specific property modified, that you want to look at.

var myFile = File('pathToFile.js');

alert(myFile.modified);

VIKEHAN
VIKEHANAuthor
New Participant
January 6, 2019

great! it works!   but can it transform to other format, like 201901160102  ?

Tomas Sinkunas
Tomas SinkunasCorrect answer
Brainiac
January 6, 2019

Sure

alert(myFile.modified.getTime());