JavaScript - CreationDate converting to Date
I am currently working on an automation process for my department to take a large mail merge document and save each individual letter to the respective folder for each permit/customer. Part of our document management rules require that every document have the creation date encoded in the file name. Not difficutl, but as I won't always get to this step the same day the document is created, I am trying to extract the Creation Date from the Document Info. However, I keep running into a wall on this. Here is my sample code and the output from it:
var s = this.info.CreationDate;
console.println(s.toString());
var d = util.scand("ddd mmm dd yyyy",s.toString());
if (d == null) {console.println("Date Conversion Failed!");} else{console.println(d);}
d = util.scand("ddd mmm dd yyyy HH:MM:ss",this.info.CreationDate);
console.println(d);
Fri Sep 26 2025 10:58:59 GMT-0500 (Central Daylight Time)
Mon Nov 03 2025 10:58:59 GMT-0600 (Central Standard Time)
Mon Nov 03 2025 10:58:59 GMT-0600 (Central Standard Time)
true
I am banging my head against the wall trying to figure out what I'm doing wrong. I have tried multiple variations on s.toString() and s as parameters, but the output is the same.
Any suggestions or tips would be greatly appreciated.
Using Acrobat Pro 2020.
