File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
How do I convert a GMT date to a local date
Joined: Aug 01, 2007
Aug 01, 2007 13:19:00
There are like 1,000 posts on this subject, but I've been reading various topics off and on all day and haven't figured out how to solve this problem I'm having.
What I've got is a date being returned from an SDK that is actually in GMT, but the timezone says EDT. When I output the date it is showing 3 hours ahead which is the GMT time.
Given a Date object, that is a GMT date/time, how do I convert this thing to a local timezone.
Many thanks for any help,
Joined: Mar 22, 2005
Aug 01, 2007 14:00:00
Welcome to JavaRanch.
The problem with the Date class is that it is totally ignorant of timezones. If timezones matter, then you should use the Calendar class and tell it specifically which timezone to use.
Ping & DNS
- updated with new look and Ping home screen widget
I agree. Here's the link:
subject: How do I convert a GMT date to a local date
Change Timezone from GMT to EST, the best way to accomplish?
Converting from GMT to Local Timezone using two seperate fields (date & time).
TimeZone Date convertion
Date vs Calendar
Need to specify the time as GMT while creating the date, JVM is on EST
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014