Jump to content
We've recently updated our Privacy Statement, available here ×

How to convert date/time to local time


ajith.devendra

Recommended Posts

Dear Friend ,

 

I'm using Current Date and Time Composite Elements to print date time on the report , but it prints server time not the local time . My server is in Malaysia and i 'm sitting in UAE. Would anyone pls help me to convert Currentdat and time to local date and time.

 

rgds

AD

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Have you tried something like the following? "-4" is the time difference between Malaysia and UAE (sorry if I'm wrong).

java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(java.time.LocalDateTime.now().plusHours(-4))

Link to comment
Share on other sites

Thanks Hozawa ,  It worked perfectly .. Appreciated your kind advice .

I have one more question related to this .. I have another country in MiddleEast   (using the Malyasia server)   which is having day light saving . How do we incorporate day light saving to the same expression 

I would appreciate your advice on this .

 

rgds

Ajith 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...