This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
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);
Have you checked out
subject: How to get Pacific Date from GMT ?
DST issue with GregorianCalendar
How can I get the midnight GMT time
Help with System Time
Date vs Calendar
java.util.Date on different JVMs on different timezones
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015