Examples of HTimeZone


Examples of org.haystack.HTimeZone

        verifyTz("London", "Europe/London");
        verifyTz("UTC", "Etc/UTC");
    }

    private void verifyTz(String name, String javaId) {
        HTimeZone tz = HTimeZone.make(name);
        TimeZone java = TimeZone.getTimeZone(javaId);
        verifyEq(tz.name, name);
        verifyEq(tz.java, java);
        verifyEq(tz, HTimeZone.make(java));
    }
View Full Code Here

Examples of org.haystack.HTimeZone

        verifyEq(tz, HTimeZone.make(java));
    }

    public void testDateTime() {
        // equality
        HTimeZone utc = HTimeZone.UTC;
        HTimeZone london = HTimeZone.make("London");

        verifyEq(HDateTime.make(2011, 1, 2, 3, 4, 5, utc, 0), HDateTime.make(2011, 1, 2, 3, 4, 5, utc, 0));
        verifyNotEq(HDateTime.make(2011, 1, 2, 3, 4, 5, utc, 0), HDateTime.make(2009, 1, 2, 3, 4, 5, utc, 0));
        verifyNotEq(HDateTime.make(2011, 1, 2, 3, 4, 5, utc, 0), HDateTime.make(2011, 9, 2, 3, 4, 5, utc, 0));
        verifyNotEq(HDateTime.make(2011, 1, 2, 3, 4, 5, utc, 0), HDateTime.make(2011, 1, 9, 3, 4, 5, utc, 0));
View Full Code Here

Examples of org.haystack.HTimeZone

        verifyEq(c.toString(), s);
        verifyEq(HCoord.make(s), c);
    }

    public void testRange() {
        HTimeZone ny = HTimeZone.make("New_York");
        HDate today = HDate.today();
        HDate yesterday = today.minusDays(1);
        HDate x = HDate.make(2011, 7, 4);
        HDate y = HDate.make(2011, 11, 4);
        HDateTime xa = HDateTime.make(x, HTime.make(2, 30), ny);
View Full Code Here

Examples of org.haystack.HTimeZone

        HDict kw = client.read("kw and not siteMeter");
        clearHisWrite(kw);

        // create some items
        HDate date = HDate.make(2010, 6, 7);
        HTimeZone tz = HTimeZone.make(kw.getStr("tz"));
        HHisItem[] write = new HHisItem[5];
        for (int i = 0; i < write.length; ++i) {
            HDateTime ts = HDateTime.make(date, HTime.make(i + 1, 0), tz);
            HVal val = HNum.make(i, "kW");
            write[i] = HHisItem.make(ts, val);
View Full Code Here

Examples of org.haystack.HTimeZone

        // check that entity has "his" tag
        if (rec.missing("his"))
            throw new UnknownNameException("Rec missing 'his' tag: " + rec.dis());

        // lookup "tz" on entity
        HTimeZone tz = null;
        if (rec.has("tz"))
            tz = HTimeZone.make(rec.getStr("tz"), false);
        if (tz == null)
            throw new UnknownNameException("Rec missing or invalid 'tz' tag: " + rec.dis());
View Full Code Here

Examples of org.haystack.HTimeZone

        // check that entity has "his" tag
        if (rec.missing("his"))
            throw new UnknownNameException("Entity missing 'his' tag: " + rec.dis());

        // lookup "tz" on entity
        HTimeZone tz = null;
        if (rec.has("tz"))
            tz = HTimeZone.make(rec.getStr("tz"), false);
        if (tz == null)
            throw new UnknownNameException("Rec missing or invalid 'tz' tag: " + rec.dis());
View Full Code Here

Examples of org.haystack.HTimeZone

                if (neg)
                    tzOffset = -tzOffset;
            }

            // timezone name
            HTimeZone tz;
            if (cur != ' ') {
                if (tzOffset != 0)
                    throw errChar("Expected space between timezone offset and name");
                tz = HTimeZone.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.