Skip to main content
Nintex Community Menu Bar
Question

How to convert date string from JSON to date format

  • December 9, 2022
  • 4 replies
  • 1001 views

Forum|alt.badge.img+2

I am retrieving JSON data and the dates come in as part of the string. I can parse the data and see it in the log.

Query JSON All Award Date - ["44907","","44562","45219"]

How do I convert the string, like "44907" to a date format so I can post the data to a date field in SharePoint?

Thanks

Translate
Did this topic help you find an answer to your question?

4 replies

bamaeric
Forum|alt.badge.img+13
  • Apprentice
  • 463 replies
  • December 9, 2022

What dates are those in a friendly format?

Take a look at the “Convert a value” workflow action: Convert a value

Translate

Forum|alt.badge.img+2
  • Author
  • Rookie
  • 5 replies
  • December 10, 2022

They are from Excel and look like this (see table below).

I’m using the “Read Excel File” connector from the Nintex Connector Gallery. https://gallery.nintex.com/t/read-excel-file

It pulls the data in as a JSON string.  I run Nintex actions to grab these dates.  They come into Nintex as their date integers if you will in string format.

I convert the string to an integer and all is well.

As soon  as I run a convert to go from integer to date I get the following error: The specified value is unknown. [Error Code: TypeCasting.UnknownCasting]

 

12/12/2022
12/31/2022
1/1/2022
10/20/2023
Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • December 12, 2022

Hi @davehtx 

You can use the Add Time to Date action to convert those number into actual Date.
Add the number to the date “01-Jan-1900”.  

You posted the following
→ Query JSON All Award Date - ["44907","","44562","45219"]. Using 44907

Add 44907 days to the date “01-Jan-1900”. Excel uses the value mean 44907 days after “01-Jan-1900”.

Configure the Add Time to Date action as below

Below is the Log to History result. 14-Dec-2022

FYI, our system date follows UK style - dd-mm-yyyy

Hope that helps.

Translate

bamaeric
Forum|alt.badge.img+13
  • Apprentice
  • 463 replies
  • December 12, 2022

Piggybacking off what @Garrett said, you should be able to use the “Add time to date” action in Nintex Automation Cloud to get the same result.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings