A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Java in General
How to get Pacific Date from GMT ?
Joined: Mar 20, 2003
Mar 27, 2003 17:32:00
I have a calendar with GMT date.
I need to get the Pacific(-8) time equivalent for the HOURS field.
How can I do that ?
Joined: Oct 08, 2001
Mar 28, 2003 11:32:00
Look into javadocs for
class. Your code might look something like this:
TimeZone tz = TimeZone.getTimeZone("EST"); TimeZone.setDefault(tz); Calendar rightNow = Calendar.getInstance(); int hour = rightNow.get(Calendar.HOUR_OF_DAY); int min = rightNow.get(Calendar.MINUTE); int day = rightNow.get(Calendar.DAY_OF_WEEK);
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: How to get Pacific Date from GMT ?
java.util.Date on different JVMs on different timezones
Help with System Time
Date vs Calendar
How can I get the midnight GMT time
DST issue with GregorianCalendar
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014