Hi All,

First, thanks for JodaTime.  I couldn't live without it!  I'm
surprised I haven't come across this earlier but I have a test that
I'd expect to pass, but doesn't:


    @Test
    public void testDateTimeEquality() throws Exception {
        final DateTime now = DateTime.now().toDateTimeISO();
        final DateTime parsed = DateTime.parse(now.toDateTimeISO().toString());
        assertEquals(now.getZone(), parsed.getZone());
        assertEquals(now, parsed);
    }

It fails with:
java.lang.AssertionError:
Expected :America/New_York
Actual   :-05:00

I've tried this test a few different ways and I am not sure how, or if
it is possible, to get the parsed DateTime to be equal to the instance
produced by DateTime.now().  Any ideas?  I'm using JodaTime 2.0.

Thanks,
Elliot

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to