Jump to content

How do I correctly insert the month into the folder path/structure?


---
 Share

Recommended Posts

Good morning, I would like to add the month to my file saving path. I managed to include the year, but I haven't figured out how to add the month. I have provided an image highlighting where I want to add the month to the folder structure/file name. Is it possible to do this?

Thank you very much!

 

image.thumb.png.e7b4cea3d889b89d030922fd7c2c6e8a.png

Link to comment
Share on other sites

d = getRecordHead("date")

commaPos = inStr(d, " ")
month = subStr(d, 1, commaPos - 1)

display(month)

Here is the quick and dirty way to isolate the month from the date.

 

If you want it in numerical format, use the following. 

month = strElement(1, "/", getRecordHead("dateshort"))

display(month)

 

Link to comment
Share on other sites

A couple options:

// Year
date().asDate.year                  // 2025

// Month (Number)
date().asDate.monthIndex            // 10

// Month (Word)
date().asDate.monthName.asString    // "October"

// Day (Number)
date().asDate.dayOfMonth            // 14

// Day (Word)
date().asDate.weekday.asString      // "Tuesday"

For your situation so far:

// All together
"C:\\" + date().asDate.year + "\" + date().asDate.monthIndex

// C:\\2025\10

 

  • Like! 1
Link to comment
Share on other sites

Well that was simpler. Hahahaha. 

Can we please for the love of god get better documentation for PCM?

Edited
Link to comment
Share on other sites

getRecordHead("date")+"_"+getRecordHead("time")

PCM that adds the current date and time to the file name.

Never overwrite a file again.

Edited
Link to comment
Share on other sites

 Share

×
×
  • Create New...