Skip to main content
Solved

convert json datetime to sql datetime

  • April 27, 2020
  • 2 replies
  • 234 views

nedwaterman
Contributor
Forum|alt.badge.img+9

Hi,

 

I'm using a JSON reader to grab data from an API. It's reading the attributes, but the datetime is formatted like so:

 

1587896100000

 

Firstly, what is the format of this? Is it JSON specific? And how can I convert to this to a SQL datetime,. which is where the output is going to be stored?

 

Thanks

N

Best answer by ebygomm

It's epoch time (seconds since 1st Jan 1970 or in this case milliseconds), if you divide the value by 1000 to get seconds from milliseconds you can then use an input value of %s in the DateTimeConverter to convert it

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • April 27, 2020

It's epoch time (seconds since 1st Jan 1970 or in this case milliseconds), if you divide the value by 1000 to get seconds from milliseconds you can then use an input value of %s in the DateTimeConverter to convert it

 


nedwaterman
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • 69 replies
  • April 27, 2020

It's epoch time (seconds since 1st Jan 1970 or in this case milliseconds), if you divide the value by 1000 to get seconds from milliseconds you can then use an input value of %s in the DateTimeConverter to convert it

 

Thank you!