Skip to main content
Nintex Community Menu Bar
Solved

Formating date to YYYYMMDD

  • August 10, 2023
  • 3 replies
  • 436 views

Forum|alt.badge.img+2

I need to format a date using a workflow from datetime to just the date in the this format: YYYYMMDD

Example:

Before: 8/7/2023 12:00:00 AM

After: 20230807

 

I only need the formatted date for a specific SharePoint 2016 list, thus why I need the workflow to format it. It is a site workflow that is scheduled to run. 

I’ve seen some guides on formatting the date but none have worked when I try to do the specific format I need. 

Best answer by bamaeric

You can use the Set Variable action to format the date and store it in a workflow variable. Here are the steps to accomplish this:

  1. Get the value of the date from the item and store it in a variable of type “Date and Time”.
  2. Add a Set Variable action to the workflow and configure it with these settings:
      - Set = txtStartDateFormatted  (this is a text workflow variable).
      - Equals Value and then click on the Insert Reference button on the right.
      - Go to the Inline Functions tab and add the fn-FormatDate function.
      - Configure this as fn-FormatDate(dtStartDate,"yyyyMMdd")
  3. You can then use that variable anywhere else in the workflow.

Also see this post: Date and Time Format Strings - Quick Reference Guide | Community (nintex.com)

3 replies

bamaeric
Forum|alt.badge.img+14
  • Apprentice
  • Answer
  • August 10, 2023

You can use the Set Variable action to format the date and store it in a workflow variable. Here are the steps to accomplish this:

  1. Get the value of the date from the item and store it in a variable of type “Date and Time”.
  2. Add a Set Variable action to the workflow and configure it with these settings:
      - Set = txtStartDateFormatted  (this is a text workflow variable).
      - Equals Value and then click on the Insert Reference button on the right.
      - Go to the Inline Functions tab and add the fn-FormatDate function.
      - Configure this as fn-FormatDate(dtStartDate,"yyyyMMdd")
  3. You can then use that variable anywhere else in the workflow.

Also see this post: Date and Time Format Strings - Quick Reference Guide | Community (nintex.com)


MillaZ
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • August 14, 2023

Hi @mstallings 
Did this solve your question? 


Forum|alt.badge.img+2
  • Author
  • August 15, 2023

You can use the Set Variable action to format the date and store it in a workflow variable. Here are the steps to accomplish this:

  1. Get the value of the date from the item and store it in a variable of type “Date and Time”.
  2. Add a Set Variable action to the workflow and configure it with these settings:
      - Set = txtStartDateFormatted  (this is a text workflow variable).
      - Equals Value and then click on the Insert Reference button on the right.
      - Go to the Inline Functions tab and add the fn-FormatDate function.
      - Configure this as fn-FormatDate(dtStartDate,"yyyyMMdd")
  3. You can then use that variable anywhere else in the workflow.

Also see this post: Date and Time Format Strings - Quick Reference Guide | Community (nintex.com)

Thanks!