Package com.ibm.icu.text

Examples of com.ibm.icu.text.DateFormat.format()


                    logln(day.format(cal.getTime()) +
                          ", Sunrise: " + df.format(sunrise) +
                          " (USNO " + df.format(exprise) + ")");
                }
                if (deltaset > MAX_DEV) {
                    errln("FAIL: " + day.format(cal.getTime()) +
                          ", Sunset: " + df2.format(sunset) +
                          " (USNO " + df.format(expset) +
                          " d=" + deltaset + "s)");
                } else {
                    logln(day.format(cal.getTime()) +
View Full Code Here


                    errln("FAIL: " + day.format(cal.getTime()) +
                          ", Sunset: " + df2.format(sunset) +
                          " (USNO " + df.format(expset) +
                          " d=" + deltaset + "s)");
                } else {
                    logln(day.format(cal.getTime()) +
                          ", Sunset: " + df.format(sunset) +
                          " (USNO " + df.format(expset) + ")");
                }
            } else {
                logln(day.format(cal.getTime()) +
View Full Code Here

                    logln(day.format(cal.getTime()) +
                          ", Sunset: " + df.format(sunset) +
                          " (USNO " + df.format(expset) + ")");
                }
            } else {
                logln(day.format(cal.getTime()) +
                      ", Sunrise: " + df.format(sunrise) +
                      " (USNO " + df.format(exprise) + ")" +
                      ", Sunset: " + df.format(sunset) +
                      " (USNO " + df.format(expset) + ")");
            }
View Full Code Here

        cal3.set(Calendar.DATE, 27);
        astro.setDate(cal3.getTime());
        double jd = astro.getJulianDay() - 2447891.5;
        double exp = -3444;
        if (jd == exp) {
            logln(d3.format(cal3.getTime()) + " => " + jd);
        } else {
            errln("FAIL: " + d3.format(cal3.getTime()) + " => " + jd +
                  ", expected " + exp);
        }
View Full Code Here

        double jd = astro.getJulianDay() - 2447891.5;
        double exp = -3444;
        if (jd == exp) {
            logln(d3.format(cal3.getTime()) + " => " + jd);
        } else {
            errln("FAIL: " + d3.format(cal3.getTime()) + " => " + jd +
                  ", expected " + exp);
        }


//        cal3.clear();
View Full Code Here

            for (int d = 0; d < DATES.length; d++) {
                int offset = TESTZONES[i].getOffset(GregorianCalendar.AD, DATES[d][0], DATES[d][1], DATES[d][2],
                                                    Calendar.SUNDAY, DATES[d][5]);
                if (offset != OFFSETS1[d]) {
                    errln("Bad offset returned by " + TESTZONES[i].getID() + " at "
                            + df.format(new Date(MILLIS[d])) + "(standard) - Got: " + offset + " Expected: " + OFFSETS1[d]);
                }
            }
        }

        // Test getOffset(long time, boolean local, int[] offsets) with local=true
View Full Code Here

        for (int i = 0; i < TESTZONES.length; i++) {
            for (int m = 0; m < MILLIS.length; m++) {
                TESTZONES[i].getOffset(MILLIS[m], true, offsets);
                if (offsets[0] != OFFSETS2[m][0] || offsets[1] != OFFSETS2[m][1]) {
                    errln("Bad offset returned by " + TESTZONES[i].getID() + " at "
                            + df.format(new Date(MILLIS[m])) + "(wall) - Got: "
                            + offsets[0] + "/" + offsets[1]
                            + " Expected: " + OFFSETS2[m][0] + "/" + OFFSETS2[m][1]);
                }
            }
        }
View Full Code Here

        for (int i = 0; i < TESTZONES.length; i++) {
            for (int m = 0; m < MILLIS.length; m++) {
                TESTZONES[i].getOffsetFromLocal(MILLIS[m], BasicTimeZone.LOCAL_STD, BasicTimeZone.LOCAL_STD, offsets);
                if (offsets[0] != OFFSETS2[m][0] || offsets[1] != OFFSETS2[m][1]) {
                    errln("Bad offset returned by " + TESTZONES[i].getID() + " at "
                            + df.format(new Date(MILLIS[m])) + "(wall/STD/STD) - Got: "
                            + offsets[0] + "/" + offsets[1]
                            + " Expected: " + OFFSETS2[m][0] + "/" + OFFSETS2[m][1]);
                }
            }
        }
View Full Code Here

        for (int i = 0; i < TESTZONES.length; i++) {
            for (int m = 0; m < MILLIS.length; m++) {
                TESTZONES[i].getOffsetFromLocal(MILLIS[m], BasicTimeZone.LOCAL_DST, BasicTimeZone.LOCAL_DST, offsets);
                if (offsets[0] != OFFSETS3[m][0] || offsets[1] != OFFSETS3[m][1]) {
                    errln("Bad offset returned by " + TESTZONES[i].getID() + " at "
                            + df.format(new Date(MILLIS[m])) + "(wall/DST/DST) - Got: "
                            + offsets[0] + "/" + offsets[1]
                            + " Expected: " + OFFSETS3[m][0] + "/" + OFFSETS3[m][1]);
                }
            }
        }
View Full Code Here

        for (int i = 0; i < TESTZONES.length; i++) {
            for (int m = 0; m < MILLIS.length; m++) {
                TESTZONES[i].getOffsetFromLocal(MILLIS[m], BasicTimeZone.LOCAL_FORMER, BasicTimeZone.LOCAL_LATTER, offsets);
                if (offsets[0] != OFFSETS2[m][0] || offsets[1] != OFFSETS2[m][1]) {
                    errln("Bad offset returned by " + TESTZONES[i].getID() + " at "
                            + df.format(new Date(MILLIS[m])) + "(wall/FORMER/LATTER) - Got: "
                            + offsets[0] + "/" + offsets[1]
                            + " Expected: " + OFFSETS2[m][0] + "/" + OFFSETS2[m][1]);
                }
            }
        }
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.