cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Convert UTC date to date

mtran21
New Contributor III

How do you convert this date โ€œ2020-09-01T00:00:00.000โ€ to this โ€œ20200901โ€?

11 REPLIES 11

mtran21
New Contributor III

I got this error
image

HIRE_DATE is a datetime data from Oracle

Then you should try:
$HIRE_DATE.toLocaleDateString({"format":"yyyyMMdd"})


Diane Miller
Community Manager

mtran21
New Contributor III

Got this error

image

Try this:

Date.parse($HIRE_DATE.toString()).toLocaleDateString(...)

mtran21
New Contributor III

Absolutely beautiful. It worked
Date.parse($HIRE_DATE.toString()).toLocaleDateString({โ€œformatโ€:โ€œyyyyMMddโ€})

Thank you @ptaylor and @dmiller