Solved

Formating date to YYYYMMDD

  • 10 August 2023
  • 3 replies
  • 71 views

Badge +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. 

icon

Best answer by bamaeric 10 August 2023, 20:06

View original

3 replies

Userlevel 5
Badge +13

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)

Userlevel 5
Badge +20

Hi @mstallings 
Did this solve your question? 

Badge +2

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!

Reply