• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getTimeStamp() returns a UTC time

 
Anupam Bhatt
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am doing the following sequence of steps to get the time from a column in database.

Timestamp ts1 = rs.getTimeStamp(1);
Date myDate = new Date(ts1.getTime());

This returns me a time according to database locale, however i require the time accroding to the JVM's locale.

I guess there must be some conversion api's [is using calendar the solution?]
any pointers?

Thanks,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anupam,
It's actually just returning you a Date object which doesn't have a locale. Take a look at SimpleDateFormat for outputting it using different locales.

You mentioned UTC times. Do you mean timezones rather than locales?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic