Thanks for the quick response, Stephen. The issue is that I don't want to
query any particular date field of DateTime but rather I essentially want to
create a unix time value that represents the fields. Let me ask in a
different way:
Current time in Australia is 2008-6-30 14:05:00. The unix time value for
this is 1214834700. I want to know the current unix time value in Los
Angeles.
Of course I'd like a generalized solution:
int unixTimeSomewhereElse(int localUnixTime, DateTimeZone localTimeZone,
DateTimeZone targetTimeZone)
{
???
}
On Thu, Jun 26, 2008 at 7:55 AM, Stephen Colebourne <[EMAIL PROTECTED]>
wrote:
> The millisecond value doesn't change. 1214798700000 is the correct
> millisecond value for Los Angeles. You only get to see the impact of
> the zone change if you use the methods on DateTime to query the
> fields.
> Stephen
>
> 2008/6/26 Adam B <[EMAIL PROTECTED]>:
> > Hello,
> >
> > I'm new to Joda-time so bear with me. I've got code converting a
> DateTime
> > from one time zone to another like so:
> >
> > DateTime dtAus = new DateTime(2008, 6, 30, 14, 5, 0, 0,
> > DateTimeZone.forID("Australia/Sydney"));
> > System.out.println(dtAus.getMillis()); //1214798700000
> > DateTime dtPST =
> dtAus.withZone(DateTimeZone.forID("America/Los_Angeles"));
> > System.out.println(dtPST.getMillis()); //still 1214798700000
> >
> > The milliseconds value is the same no matter what time zone the DateTime
> > object is using. How then do I get the milliseconds that represents
> > 2008-6-29 21:5:00, (the time in America/Los_Angeles when it's 2008-6-30
> > 14:05:00 in Australia/Sydney)?
> >
> > Much thanks.
> > - Adam
> > -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Joda-interest mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/joda-interest
> >
> >
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest