A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: getTimeStamp() returns a UTC time
Stumped By HashSet
Display date and time in users Timezone?
Calendar with Locale
Extracting and Comparing Data
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014