โ09-27-2019 12:21 PM
I have tried using Date.parse() but it gives a NaN error.
โ09-30-2019 07:34 AM
Hi Shirali,
I have converted โJun 17, 2019 12:00 AMโ into โ06/17/2019โ .
This is solved in two ways in the Pipeline attached (ConvertDate_2019_09_30):
(match $date.slice(0,4){"Jan "=>โ01/โ,"Feb "=>โ02/โ,โMarโ=>โ03/โ,"Apr "=>โ04/โ,โMayโ=>โ05/โ,"Jun "=>โ06/โ,"Jul "=>โ07/โ,"Aug "=>โ08/โ,"Sep "=>โ09/โ,"Oct "=>โ10/โ,"Noe "=>โ11/โ,โDec โ=>โ12/โ,} + $date.slice(4,12).replaceAll(โ, โ,โ/โ))
Regards,
Nikola Minovski
โ09-30-2019 09:57 AM
Thank you! This worked.
Shirali
โ09-30-2019 11:50 AM
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"})