Skip to main content
Solved

Is it possible convert milliseconds to %Y-%m-%d %H:%M:%S?

  • March 7, 2023
  • 4 replies
  • 64 views

david_
Contributor
Forum|alt.badge.img+8

How I can convert milliseconds (for example: 1663767945000) to %Y-%m-%d %H:%M:%S ?

 

I tried with a DataTimeConverter transformer but it doesn't detect the input format.

 

Any ideas?

 

Thank you.

Best answer by david_r

You can divide the milliseconds by 1000 and send it into the DateTimeConverter with something like:

imageResult:

1663767945000 -> 2022-09-21 13:45:45

 

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.

4 replies

david_r
Celebrity
  • 8392 replies
  • Best Answer
  • March 7, 2023

You can divide the milliseconds by 1000 and send it into the DateTimeConverter with something like:

imageResult:

1663767945000 -> 2022-09-21 13:45:45

 


david_
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 15 replies
  • March 7, 2023

Hi @david_r​ , thank you for your quick answer!

 

Have you tried running your example? I did the same but the DateTimeConverter reject the execution.

 

milliseconts with datetimeconverter


david_
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 15 replies
  • March 7, 2023

Hi @david_r​ again, sorry, it was my fault.

 

I don't know why the dateTimeConverter set the Datetime Attibutes as "@Value...". Now it is working.

 

Capture2 

Thanks a lot!

 

Regards.


david_r
Celebrity
  • 8392 replies
  • March 7, 2023

Hi @david_r​ again, sorry, it was my fault.

 

I don't know why the dateTimeConverter set the Datetime Attibutes as "@Value...". Now it is working.

 

Capture2 

Thanks a lot!

 

Regards.

Good to hear. The @Value()-thing is due to a (very annoying) bug, I believe it's been fixed in later versions.