And in fact, your way of constructing the date-time has an impact on
what you see too.

new DateTime()                              // create the current time
now in the local time-zone
   .withZone(LOS_ANGELES)         // adjust that to Los Angeles
   .withDate(2010, 11, 7)                 // set the date
   .withTime(1, 0, 0, 0)                    // set the time

With the latest in svn, whether you get -07:00 or -08:00 will depend
on the time of year that you run the test.

The svn code tries to retain the current offset, so if you run the
test in winter then the offset will be retained as -08:00, whereas if
you run the test in summer, the offset will be retained as -07:00.

Using withEarlierOffsetAtOverlap() or withLaterOffsetAtOverlap() will
lock in the one you want.

Also, calling
 new DateTime(2010, 11, 7, 1, 0, 0, 0, LOS_ANGELES)
will always use the Summer time (ie. its a much more reliable way to
create the datetime.)

Stephen


On 8 May 2011 10:51, Stephen Colebourne <scolebou...@joda.org> wrote:
> Back from holiday...
>
> The critical part of the test passes with svn, but your testing masked
> it. The line number of the failing assert is different in your two
> runs - in the first it failed where the bug was, in the second it
> failed in your "first sanity check".
>
> That failed because constructing the date-time choose -08:00 rather
> than -07:00 now. Adding a offset adjuster (withEarlierOffsetAtOverlap)
> allows a simple pick of the required option:
>        Instant fallFirst1Am = new DateTime().withZone(LOS_ANGELES)
>            .withDate(2010, 11, 7).withTime(1, 0, 0,
> 0).withEarlierOffsetAtOverlap().toInstant();
>
> So, the actual problem is fixed in svn
> Stephen
>
>
>
> On 27 April 2011 16:04, Chris Povirk <cpov...@google.com> wrote:
>> Interestingly, it now seems to be broken in the opposite direction:
>>
>>> expected:<2010-11-07T09:00:00.000Z> but was:<2010-11-07T10:00:00.000Z>
>>
>> As opposed to the old:
>>
>>> expected:<2010-11-07T09:00:00.000Z> but was:<2010-11-07T08:00:00.000Z>
>>
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today.  Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>> _______________________________________________
>> Joda-interest mailing list
>> Joda-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to