A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
getTimeStamp() returns a UTC time
Joined: Mar 12, 2004
Jan 05, 2007 09:10:00
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?]
Joined: May 26, 2003
Jan 05, 2007 17:34:00
It's actually just returning you a Date object which doesn't have a locale. Take a look at
for outputting it using different locales.
You mentioned UTC times. Do you mean timezones rather than locales?
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: getTimeStamp() returns a UTC time
Stumped By HashSet
Calendar with Locale
Display date and time in users Timezone?
Extracting and Comparing Data
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013