ajith.devendra Posted May 14, 2018 Share Posted May 14, 2018 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. rgdsAD Link to comment Share on other sites More sharing options...
hozawa Posted May 16, 2018 Share Posted May 16, 2018 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 More sharing options...
ajith.devendra Posted May 16, 2018 Author Share Posted May 16, 2018 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 . rgdsAjith Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now