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

Need help withTime format Conversion

Shrabanti
New Contributor II

Hi All,
I am trying change a date format with expression.

Input is a string value: โ€œ04/23/2021 12:00:00 AMโ€
Output should be โ€˜yyyy-MM-dd HH:mm:ssโ€™ format

I am trying data parse the incoming date format but unable find proper format for input date.
Date.parse($CertActivityDate,โ€œmm/dd/yyyy hh:mm:ss AMโ€).toLocaleDateTimeString( { โ€œformatโ€:โ€œyyyy-MM-dd HH:mm:ssโ€ } )

Could you please siggest.

4 REPLIES 4

bojanvelevski
Valued Contributor

Hi @Shrabanti,

Use the following expression:

Date.parse("04/23/2021 12:00:00 AM","MM/dd/yyyy HH:mm:ss a").toLocaleDateTimeString({"format":"yyyy-MM-dd HH:mm:ss"})

Regards,
Bojan

@bojanvelevski Thank you it worked.
Could you please also point me where I can see all different time formats.

Thanks & Regards,
Shrabanti

You can refer to these links for more information:

SimpleDateFormat

ParsingDate

@Shrabanti

The below post looks useful:

Regards,
Spiro Taleski