0

I am using below code in my application which is being accessed in different timezones. Although it shows current time in CET for me(in India), It is not correct when accessed from Paris( it might be from other timezones).

 <%
 SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
 java.util.Date now = new java.util.Date();
 dateFormatGmt.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
%>
            <%=dateFormatGmt.format(now)%>
Jaydeep
  • 149
  • 2
  • 5
  • 19
  • You are using the server side Date, try using clientside date see http://stackoverflow.com/questions/13/determine-a-users-timezone – Scary Wombat Jul 07 '16 at 05:52
  • I can getTimezone offset but still have to convert it into CET time. And the timezone offset will be different for different places. – Jaydeep Jul 07 '16 at 06:45

0 Answers0