Hi Suganthi,

The java.util.Date object has no timezone information, so there is no
such conversion possible.

Since you're already posting on the Joda-Time mailing list, the
easiest fix is to stop using java.util.Date altogether and switch to
using Joda's DateTime class.

If you're forced to use util.Date (I think there is a UN resolution
against that... there should be), you'll have to carry around the time
zone information in a separate variable and pass it into the
DateFormat before you parse or print a util.Date as String. You can
also use util.Calendar instead of util.Date. The Calendar object
carries a time zone with it, but keep in mind that if you use it and
DateFormat together, you still have to set the time zone on the
DateFormat by hand. It's an error-prone mess, avoid if you can.


Hope this helps,

Barend



On Wed, Apr 22, 2009 at 7:54 PM, suganthi kaliamoorthy
<suganth...@yahoo.com> wrote:
>
> Hi,
>
> Can someone please help how to convert Date object from one timezone to 
> another?
>
> I have java.util.Date object with currentTime in one zone. Have to convert 
> this to date of different timezone.
>
> Thanks,
> Suganthi.
>

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to