File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getTimeStamp() returns a UTC time

 
Anupam Bhatt
Ranch Hand
Posts: 81
  • 0
  • 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: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • 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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic