timestamp with local time zone

I have database column insert_date timestamp(6) with local timezone.  In my java rowmaper class I have the following mapping.
muObj.setInsertDate(rs.getTimestamp("INSERT_DATE", Calendar.getInstance(TimeZone.getDefault())));

However in my jsp i don't see the correct date. I am in CST and I see a time 5 hours ahead i.e. GMT.  In the database column if I look at the dates are correct and is in CST.  Is there a double conversion going on which is making the date to show in GMT. I know I am doing something wrong in my rowmapper....
lotrzzAsked:
Who is Participating?
 
ksivananthCommented:
looks like the server where the JSP hosted is running on GMT
0
 
ksivananthCommented:
try changing the default timezone,

TimeZone.setDefault( TimeZone.getTimeZone( "CST" ) ) ;

make sure the CST is sup[ported, if not give the long name
0
 
lotrzzAuthor Commented:
it's my local tomact 6.0 server.... should be in CST too
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
lotrzzAuthor Commented:
I tried this... didn't help still I am getting time in GMT.

TimeZone myTz= TimeZone.getTimeZone("GMT-06:00");
TimeZone.setDefault(myTz);
muObj.setInsertDate(rs.getTimestamp("INSERT_DATE", Calendar.getInstance(TimeZone.getDefault())));

I printed out the timezone and it is showing GMT - 06:00
0
 
ksivananthCommented:
you need to set the timezone before creating connection!
0
 
lotrzzAuthor Commented:
But I am using spring, so do I need to set this in the application-context file?
0
 
lotrzzAuthor Commented:
I changed the server and re-installed tomcat again and that fixed the issue.  This was a issue with the server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.