Format Date Time yyyymmdd_hhmmssGreetings,
I am having an issue with a date-time format when save a csv file.
The filename should be like "Summary_20231103_082637".
formattedDate = Format(Today(), "yyyymmdd_hhmmss");
filename = Convert File Path("C:\Path\Summary_" || formattedDate || ".xlsx", absolute );
if(File Exists (filename),
dt << Save (filename, Mode("Append")),
dt << Save (filename));
I tried to format the datetime with
formatDate = Format(Today(), "yyyymmdd");
Show(formatDate);
Result: "20231103"
format1 = Format(Today(), "h:m:s");
Show(format1);
Result: "6:18:32 PM"
format2 = Format(Today(), "
- <->");
Show(format2);
Result: "11/03/2023"
Automation and ScriptingRe: Format Date Time yyyymmdd_hhmmssYou don't indicate which JMP version you have, but if possible I would use Format Pattern (I think it was added in JMP16)
Names Default To Here(1);
formatted_date = Format(Today(), "Format Pattern", "<YYYY><MM><DL><DD>_<HH24><MM><SS>");
<P>Other option which will work always, is to build it from start as a string using functions such as Year(), Month(), Day(), and so on</P></SS></MM></HH24></DD></DL></MM></YYYY>