Examples of withZone()


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

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

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

        assertEquals(dt.toString(), "10", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "6", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "7", f.print(dt));
       
        dt = new DateTime(2004, 6, 9, 0, 0, 0, 0, UTC);
        assertEquals(dt.toString(), "12", f.print(dt));
    }
View Full Code Here

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

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

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

        assertEquals(dt.toString(), "10", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "6", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "19", f.print(dt));
       
        dt = new DateTime(2004, 6, 9, 0, 0, 0, 0, UTC);
        assertEquals(dt.toString(), "0", f.print(dt));
    }
View Full Code Here

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

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

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

        assertEquals(dt.toString(), "10", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "6", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "19", f.print(dt));
       
        dt = new DateTime(2004, 6, 9, 0, 0, 0, 0, UTC);
        assertEquals(dt.toString(), "24", f.print(dt));
    }
View Full Code Here

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

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

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

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

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

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

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

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

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

    //-----------------------------------------------------------------------
    public void testFormat_fractionOfSecond() {
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.