Skip to main content
Solved

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


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

 

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

david_r
Evangelist

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
  • Contributor
  • 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
  • Contributor
  • 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
Evangelist
david_ wrote:

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.


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