Skip to main content
Nintex Community Menu Bar
Answer

Removing Time from DateTime variables

  • September 21, 2023
  • 2 replies
  • 884 views

Iramos85
Forum|alt.badge.img+1

I have a pretty straightforward form that is inserting DateTime variables from a SharePoint list but whenever they print to email, the data always includes the time as well as the date - which is not something that was included, so it always shows up as “12:00:00 AM”. Ideally, I’d like to format that out - but so far I havent found a way to do that. 

For example my Input would be:


and the output is:
 

 

SharePoint settings are as follows:
 

 

 

Best answer by bamaeric

Another option is to use a Regular Expression action to remove everything after the date.

Here is how to do that:

  1. Add a Regular Expression action to the workflow.
  2. Configure this action with these settings:
     - String = Date of Request
     - String operation = Replace
     - Pattern = \s[0-9]+:[0-9]+:[0-9]+.{3}$
     - Replacement string = Leave empty
     - Output = txtDateOnly  (this is a text workflow variable that you create)
  3. This returns only the date with the time, AM/PM, and spaces removed.
  4. You can then use this text workflow variable in your email.

 

2 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • September 21, 2023

Hi @Iramos85 

You can select the return type for the Datetime as either Long Date or Short Date to omit out the time.

 


bamaeric
Forum|alt.badge.img+14
  • Apprentice
  • Answer
  • September 21, 2023

Another option is to use a Regular Expression action to remove everything after the date.

Here is how to do that:

  1. Add a Regular Expression action to the workflow.
  2. Configure this action with these settings:
     - String = Date of Request
     - String operation = Replace
     - Pattern = \s[0-9]+:[0-9]+:[0-9]+.{3}$
     - Replacement string = Leave empty
     - Output = txtDateOnly  (this is a text workflow variable that you create)
  3. This returns only the date with the time, AM/PM, and spaces removed.
  4. You can then use this text workflow variable in your email.