Converting timestamp to real date

How to convert `"timestamp":1619601319518,` to a real date/time.

 

,"timestamp":1619601319518, is the value returned from the YouTrack api/issues/BE21-142/activities call.

3 comments
Comment actions Permalink
Official comment

Hi! 

I'm Sergey from the YouTrack team. 

This is Unix time (Epoch time). You can convert it using any online tool like this one. If you process the response in code, then you can look the solution up for your language as there should definitely be one. For example, this is how it can be done in vanilla Javascript.

Comment actions Permalink

Actually the value returned by YT is NOT a unixtime! As of today (June 28th 2022) epoch counter is 1,656,348,281 while the value, returned by YT is much larger - 1,619,601,319,518 (I added commas for better readability). While standard Epoch time is counted in seconds (as described on the wikipedia page you provided the link to!) YT returns the value in milliseconds, so one has to strip off the last 3 digits to get a real unixtime.

Can you please update your documentation?

0
Comment actions Permalink

Hello,

My name is Lena; I'm from the YouTrack team as well. 

Thank you for paying our attention to this situation. I sent a request to our technical writers, and we will update the docs as soon as possible. Just to clarify, I found two articles where the UNIX format is mentioned:

https://www.jetbrains.com/help/youtrack/devportal/resource-api-workItems.html#get_all-IssueWorkItem-method
https://www.jetbrains.com/help/youtrack/devportal/v1-IssueWorkItem.html#properties

Please let me know if I missed something and if you found more articles. 

We appreciate your cooperation. 

0

Please sign in to leave a comment.