Date Format Change | Community
Skip to main content
Level 2
June 2, 2020
Solved

Date Format Change

  • June 2, 2020
  • 2 replies
  • 8573 views

How can I change a date format of a field to use in an output?  This is different from using java in file naming.

 

YYYY-MM-DD hh:mm:ss

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jyoti_Yadav

Hi,

1) If you are trying to change date format in Email Design :

You can change your date format by using Format expression.

Use below in your HTML code:

data-nl-format="%4Y-%2M-%2D %2h:%2n:%2s"

Something like this: 

<p >Booking Date:<span  data-nl-type="datetime"  data-nl-format="%4Y-%2M-%2D %2h:%2n:%2s">Booking Date </span></p>

 

2) If you are trying to change date format in a workflow, you can use below code:

const FORMAT_120 ="%4Y-%2M-%2D %2h:%2n:%2s"
instance.vars.workflowExecutionInitiatedAt=formatDate(date,FORMAT_120);

 

Thanks

2 replies

Raj_Ganta-1
Level 5
June 2, 2020
Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
June 3, 2020

Hi,

1) If you are trying to change date format in Email Design :

You can change your date format by using Format expression.

Use below in your HTML code:

data-nl-format="%4Y-%2M-%2D %2h:%2n:%2s"

Something like this: 

<p >Booking Date:<span  data-nl-type="datetime"  data-nl-format="%4Y-%2M-%2D %2h:%2n:%2s">Booking Date </span></p>

 

2) If you are trying to change date format in a workflow, you can use below code:

const FORMAT_120 ="%4Y-%2M-%2D %2h:%2n:%2s"
instance.vars.workflowExecutionInitiatedAt=formatDate(date,FORMAT_120);

 

Thanks

Marcel_Szimonisz
Community Advisor
Community Advisor
June 3, 2020
@jyoti_yadav do you know where one can find these attributes such as data-nl-format is there a guide to them?