Forum Discussion
tstack
7 years agoFormer Employee
You can specify the format to be used for parsing by passing it as the second argument to Date.parse(). The toLocaleDateTimeString() method can also take an optional parameter where you can specify the format to use when turning the date into a string:
Date.parse("Jun 17, 2019 12:00 AM", "MMM dd, yyyy hh:mm a")
.toLocaleDateTimeString({format: "MM/dd/YYYY"})