| Author |
getTimeStamp() returns a UTC time
|
Anupam Bhatt
Ranch Hand
Joined: Mar 12, 2004
Posts: 81
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
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?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: getTimeStamp() returns a UTC time
|
|
|