Lines Matching refs:format
155 * Format the output.
159 sdf->format(today,fmtOffset, pos);
247 logln(*s + " P> " + ((DateFormat*)fullFmt)->format(d, str));
411 logln((UnicodeString)" Result = " + df->format(aug13, buf.remove()));
417 df->format(aug13, buf, pos);
432 df->format(aug13, buf, &posIter, status);
448 dateFormats[0]->format(aug13, buf, NULL, status);
460 * General parse/format tests. Add test cases as needed.
466 // Milliseconds are left-justified, since they format as fractions of a second
505 DateFormatTest::tryPat994(SimpleDateFormat* format, const char* pat, const char* str, UDate expected)
511 format->applyPattern(pat);
512 UDate date = format->parse(str, status);
521 ((DateFormat*)format)->format(date, f);
523 logln((UnicodeString)" format -> " + f);
549 UnicodeString format("yyyyMMddHHmmssSSS");
552 SimpleDateFormat *formatter = new SimpleDateFormat(format, status);
559 ((DateFormat*)formatter)->format(date1, now);
564 else ((DateFormat*)formatter)->format(date2, then);
609 ((Format*)fmt)->parseObject(str, o, status);
618 UnicodeString formatted; ((Format*)fmt)->format(o, formatted, status);
644 UnicodeString juneStr; fmt->format(june, juneStr);
645 UnicodeString julyStr; fmt->format(july, julyStr);
647 logln((UnicodeString)"format(June 15 1997) = " + juneStr);
649 UnicodeString s; fmt->format(d, s);
653 logln((UnicodeString)"format(July 15 1997) = " + julyStr);
655 fmt->format(d, s);
737 UnicodeString formatResult; (*(DateFormat*)&sdf).format(d, formatResult);
738 logln((UnicodeString)" format -> " + formatResult);
743 UnicodeString format2; (*(DateFormat*)&sdf).format(d2, format2);
744 logln((UnicodeString)" format -> " + format2);
769 UnicodeString dateString; ((DateFormat*)formatter)->format(currentTime_1, dateString);
771 logln((UnicodeString)"format(" + dateToString(currentTime_1) + ") = " + dateString);
820 UnicodeString format;
821 full->format(when, format);
822 logln(prefix + "OK: " + format);
823 if (0!=format.compareBetween(0, expected.length(), expected, 0, expected.length()))
824 errln((UnicodeString)"FAIL: Expected " + expected + " got " + format);
928 ((DateFormat*)dateParse)->format(date, result);
1009 UnicodeString temp; formatter->format(date, temp);
1060 // format every way
1062 UnicodeString("simple format: "), UnicodeString("04/04/97 23:00 GMT+00:00"),
1064 UnicodeString("full format: "), UnicodeString("Friday, April 4, 1997 11:00:00 o'clock PM GMT+00:00"),
1066 UnicodeString("long format: "), UnicodeString("April 4, 1997 11:00:00 PM GMT+00:00"),
1068 UnicodeString("default format: "), UnicodeString("04-Apr-97 11:00:00 PM"),
1070 UnicodeString("short format: "), UnicodeString("4/4/97 11:00 PM"),
1080 result = fmt->format(greenwichdate, result);
1124 dfFrench->format(testDate, out);
1129 dfUS->format(testDate, out);
1162 /* Create a full format for output */
1206 full->format(when, str);
1290 f.format((UDate)0, out, pos);
1292 // The bug is that the call to format() will crash. By not
1305 fmt.format(date, str);
1626 gotfmt.format(got, gotstr);
1636 // This only happens if expected is in wrong format --
1669 * 'f': Format date [i+2] (as parsed using pattern [0]) and expect string [i+3].
1673 * 'F': Format date [i+2] and expect string [i+3],
1678 * 'f': Format date [i+3] and expect string [i+4].
1709 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1711 fmt.format(date, str.remove()));
1719 univ.format(date, str.remove()),
1720 format(parsedate, str2.remove()));
1733 univ.format(date, str.remove()),
1734 univ.format(parsedate, str2.remove()));
1738 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1740 fmt.format(date, str.remove()));
1748 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1750 fmt.format(date, str.remove()));
1755 univ.format(date, str.remove()),
1756 univ.format(parsedate, str2.remove()));
1780 * Format date [i+1] and expect string [i+2].
1810 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1812 fmt.format(date, str.remove()));
1863 logln("cross format/parse tests");
1890 formats[j].format(d, test);
1896 errln((UnicodeString)"FAIL: format " + k +
1897 " incorrectly parsed output of format " + j +
1901 logln((UnicodeString)"OK: format " + k + " parsed ok");
1904 errln((UnicodeString)"FAIL: format " + k +
1905 " could not parse output of format " + j +
1977 univ.format(d, result);
2056 full->format(*c, expect, pos); // expected = normal full
2059 fullrelative ->format(*c, result, pos);
2060 en_full ->format(*c, normalResult, pos);
2063 errln("FAIL: Relative Format ["+bannerStr+"] of "+normalResult+" failed, expected "+expect+" but got " + result);
2065 logln("PASS: Relative Format ["+bannerStr+"] of "+normalResult+" got " + result);
2073 UnicodeString parseFormat; // parse rel->format full
2074 en_full->format(d, parseFormat, status);
2077 en_full->format(*c, origFormat, pos);
2122 full->format(now, result1, status);
2123 Format *fullClone = full->clone();
2128 fullClone->format(now, result2, status);
2152 full->format(now, result1, status);
2153 Format *fullClone = full->clone();
2158 fullClone->format(now, result2, status);
2968 fmt.format(*cal,result,pos);
3025 formatters[i]->format(*calendars[i], buf, fpos);
3039 formatters[i]->format(*calendars[j], buf, fpos);
3041 errln((UnicodeString)"FAIL: Different format result with a different calendar for the same time -"
3129 str1 = fmt1->format(dt1, str1);
3136 str11 = fmt1->format(dt11, str11);
3153 str2 = fmt2->format(dt2, str2);
3160 str22 = fmt2->format(dt22, str22);
3177 str3 = fmt3->format(dt3, str3);
3184 str33 = fmt3->format(dt33, str33);
3201 str4 = fmt4->format(dt4, str4);
3208 str44 = fmt4->format(dt44, str44);
3243 strf = fmtf->format(dt, strf);
3244 strl = fmtl->format(dt, strl);
3245 strm = fmtm->format(dt, strm);
3246 strs = fmts->format(dt, strs);
3296 // Test case for localized GMT format parsing
3297 // with no delimitters in offset format (Chinese locale)
3331 fmt->format(d1, s1);
3332 fmt->format(d2, s2);
3377 // format date back to string
3379 out = fmt1->format(dt1, out);
3405 sdf->format(thedate,result,pos);
3418 usf->format(parsedate,parsedres,pos);
3419 usf->format(thedate,expres,pos);