Skip to main content
Solved

convert json datetime to sql datetime


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

 

View original
Did this help you find an answer to your question?

2 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 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
  • April 27, 2020
ebygomm wrote:

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!


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