Examples of withZone()


Examples of org.joda.time.DateTime.withZone()

    public void testFormat_fractionOfSecond() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("SSS").withLocale(Locale.UK);
        assertEquals(dt.toString(), "040", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "040", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "040", f.print(dt));
    }
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

        assertEquals(dt.toString(), "040", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "040", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "040", f.print(dt));
    }

    //-----------------------------------------------------------------------
    public void testFormat_fractionOfSecondLong() {
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

    public void testFormat_fractionOfSecondLong() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("SSSSSS").withLocale(Locale.UK);
        assertEquals(dt.toString(), "040000", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "040000", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "040000", f.print(dt));
    }
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

        assertEquals(dt.toString(), "040000", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "040000", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "040000", f.print(dt));
    }

    //-----------------------------------------------------------------------
    public void testFormat_zoneText() {
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

    public void testFormat_zoneText() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("z").withLocale(Locale.UK);
        assertEquals(dt.toString(), "UTC", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "EDT", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "JST", f.print(dt));
    }
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

        assertEquals(dt.toString(), "UTC", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "EDT", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "JST", f.print(dt));
    }

    public void testFormat_zoneLongText() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

    public void testFormat_zoneLongText() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("zzzz").withLocale(Locale.UK);
        assertEquals(dt.toString(), "Coordinated Universal Time", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "Eastern Daylight Time", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "Japan Standard Time", f.print(dt));
    }
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

        assertEquals(dt.toString(), "Coordinated Universal Time", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "Eastern Daylight Time", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "Japan Standard Time", f.print(dt));
    }

    //-----------------------------------------------------------------------
    public void testFormat_zoneAmount() {
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

    public void testFormat_zoneAmount() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("Z").withLocale(Locale.UK);
        assertEquals(dt.toString(), "+0000", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "-0400", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "+0900", f.print(dt));
    }
View Full Code Here

Examples of org.joda.time.DateTime.withZone()

        assertEquals(dt.toString(), "+0000", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "-0400", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "+0900", f.print(dt));
    }

    public void testFormat_zoneAmountColon() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.