We have one of our application hosted on a application server installed on machine working in CST timings. Now in the application footer we are showing the Last Login time and date using java.util.date().toString();
Now from reference of this post I can say java.util.Date().toString() is using TimeZone.getDefault() method which, in turn, will default to the time zone of the operating system it is running on (i.e. the host).
So the application Should show the timings according to CST timzone but it is not happening only for this server, it is always showing GMT timzone.
Here is a attached screenshot showing time configuration and the results from ‘time’ command on the serve, as well as the application Admin UI, showing time in GMT which is visible in footer.
So I am looking for the possible causes as why java.util.date.toString()
is showing this unexpected behavior and what is the solution for that?