Need help withTime format Conversion

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.

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

3 Likes

@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

1 Like