[Fl...] Posted March 6 Share Posted March 6 Is there a relatively simple way to output the modification date of a file using PCM? Best regards, Florian Link to comment Share on other sites More sharing options...
[An...] Posted March 6 Share Posted March 6 Hopefully this is what you are looking for! With a few edits, can output the data however you want. The below will just output in a display window. // Path to your file as a String, can be any file (OR folder!) file = "C:\Path\To\Your\File\example.txt" // Modified Date display("Modified Date: ", file.asFilename.dates.modified.first) // Modified Time display("Modified Time: ", file.asFilename.dates.modified.second) // =========================== // Bonus // =========================== // Accessed Date display("Accessed Date: ", file.asFilename.dates.accessed.first) // Accessed Time display("Accessed Time: ", file.asFilename.dates.accessed.second) // Created Date display("Created Date: ", file.asFilename.dates.created.first) // Created Time display("Created Time: ", file.asFilename.dates.created.second) Link to comment Share on other sites More sharing options...
[Mi...] Posted March 6 Share Posted March 6 Please sign in to view this quote. file="C:\Temp\test.txt" file.asFilename.creationTimestamp file.asFilename.modificationTimestamp Link to comment Share on other sites More sharing options...
[An...] Posted March 6 Share Posted March 6 Please sign in to view this quote. ⬆ a better simple solution! 👏 Link to comment Share on other sites More sharing options...
[Fl...] Posted March 7 Author Share Posted March 7 Thank you both very much for your replies. Now i get the month as a string. Is it possible to get the date format only in numbers, or the as the amount of days as in: date(1).asDate.asDays Thank you. Link to comment Share on other sites More sharing options...
[Mi...] Posted March 7 Share Posted March 7 Please sign in to view this quote. Yep, it's possible. For Instance: date=file.asFilename.dates.created.first or date=file.asFilename.creationTimestamp // date in Numbers: date=date.dayOfMonth.asString + "." + date.monthIndex.asString + "." + date.year.asString Link to comment Share on other sites More sharing options...
[Fl...] Posted March 7 Author Share Posted March 7 Once again, thank you very much, exactly what i needed. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in