Hi,
I'm quering the UTC time from a named query and showing it on label component.
I have this binding on the label coponent but, it does not convert it into the local time.
Am I doing something wrong?
Hi,
I'm quering the UTC time from a named query and showing it on label component.
I have this binding on the label coponent but, it does not convert it into the local time.
Am I doing something wrong?
Rather than a format transform, have you tried using an expression transform with the getTimezoneOffset() expression?
You would need to turn the {value} into a date first though. I think you could use fromMillis()?
Okay, I understand why there is a 30 min offset. getTimezoneOffset() return value 5.5 in this case and addHours() rounds it up to 6.
But I can't figure out the right way to do this.
Why? Why not use an expression binding of now()?
My goal is to find the best method to display a timestamp from DB in local timezone in label component. Not really to display the current time.
This was just an example that I tried to use to show the situation.
Change your expression to addMinutes({value}, getTimezoneOffset({value}) * 60)
But why? Are you trying to check the DB server clock is correct? It seems strange.