[Fl...] Posted March 6, 2025 Share Posted March 6, 2025 Is there a relatively simple way to output the modification date of a file using PCM? Best regards, Florian Link to comment https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/ Share on other sites More sharing options...
[An...] Posted March 6, 2025 Share Posted March 6, 2025 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 https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127763 Share on other sites More sharing options...
[Mi...] Posted March 6, 2025 Share Posted March 6, 2025 Please sign in to view this quote. file="C:\Temp\test.txt" file.asFilename.creationTimestamp file.asFilename.modificationTimestamp Link to comment https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127765 Share on other sites More sharing options...
[An...] Posted March 6, 2025 Share Posted March 6, 2025 Please sign in to view this quote. ⬆ a better simple solution! 👏 Link to comment https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127767 Share on other sites More sharing options...
[Fl...] Posted March 7, 2025 Author Share Posted March 7, 2025 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 https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127835 Share on other sites More sharing options...
[Mi...] Posted March 7, 2025 Share Posted March 7, 2025 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 https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127839 Share on other sites More sharing options...
[Fl...] Posted March 7, 2025 Author Share Posted March 7, 2025 Once again, thank you very much, exactly what i needed. Link to comment https://qualityforum.zeiss.com/topic/22661-pcm-command-for-the-modification-date-of-a-file/#findComment-127841 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