I have an RHEL6 Linux server in Mexico running my application. The server timezone is CDT. So when I issue the "date" command on the Linux command line I get the correct date and time which is an hour behind me. (I'm in EDT).
However, when I use the java.util.date object and display the current server date in a JSP, it is displaying the proper date and time for my timezone.
For instance I use:
<% ...
Date local = new Date();
out.write("'" + local + "'");
... %>
This would show, say,
Tue Aug 22 14:39:13 EDT 2017
, the date and time I am writing this. But I need to display
Tue Aug 22 13:39:13 CDT 2017
which is the actual date and time of the server.
I'm somewhat new to Java, JSP. So I'm not sure exactly how to get the output the way I need it.
Thank You