Jump to content
Private Messaging is activated - check "How to" on how to disable it ×

PCM command for the modification date of a file


---
 Share

Recommended Posts

---

Is there a relatively simple way to output the modification date of a file using PCM?

nderungsdatum_modification_date.JPG.96763ca0bdcdd079dbe43aa424ade147.JPG

Best regards, Florian

Link to comment
Share on other sites

---

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

---

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

---

Thank you both very much for your replies.

Now i get the month as a string.

nderungsdatum_modification_date_PCM_output.JPG.0a694fbe795e25c68ccf3da07aaf3731.JPG

Is it possible to get the date format only in numbers, or the as the amount of days as in:

date(1).asDate.asDays

image.png.bc859ce69ea783d3fc21b60ed389ffd7.png

Thank you.

Link to comment
Share on other sites

---

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

 Share

×
×
  • Create New...