Home
last modified time | relevance | path

Searched refs:DateFormat (Results 1 – 23 of 23) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDateFormatTest.java19 import java.text.DateFormat;
34 DateFormat format = DateFormat.getInstance(); in test_clone()
35 DateFormat clone = (DateFormat) format.clone(); in test_clone()
45 Locale[] locales = DateFormat.getAvailableLocales(); in test_getAvailableLocales()
53 DateFormat f1 = DateFormat.getDateTimeInstance(DateFormat.SHORT, in test_getAvailableLocales()
54 DateFormat.SHORT, locales[i]); in test_getAvailableLocales()
65 DateFormat format = DateFormat.getInstance(); in test_getCalendar()
75 SimpleDateFormat f2 = (SimpleDateFormat) DateFormat.getDateInstance(); in test_getDateInstance()
77 assertTrue("Wrong default", f2.equals(DateFormat.getDateInstance( in test_getDateInstance()
78 DateFormat.DEFAULT, Locale.getDefault()))); in test_getDateInstance()
[all …]
DDataFormatFieldTest.java27 import java.text.DateFormat;
28 import java.text.DateFormat.Field;
43 DateFormat.Field realField = DateFormat.Field in test_ConstructorLjava_lang_StringLjava_lang_String()
46 DateFormat.Field.ERA, realField); in test_ConstructorLjava_lang_StringLjava_lang_String()
48 DateFormat.Field realField2 = DateFormat.Field in test_ConstructorLjava_lang_StringLjava_lang_String()
51 DateFormat.Field.DAY_OF_MONTH, realField2); in test_ConstructorLjava_lang_StringLjava_lang_String()
54 static class MyField extends DateFormat.Field {
76 DateFormat.Field realField = DateFormat.Field in test_ConstructorLjava_lang_StringI()
79 DateFormat.Field.DAY_OF_WEEK, realField); in test_ConstructorLjava_lang_StringI()
92 DateFormat.Field realField = DateFormat.Field in test_Constructor2()
[all …]
DFieldPositionTest.java19 import java.text.DateFormat;
29 FieldPosition fpos = new FieldPosition(DateFormat.MONTH_FIELD); in test_ConstructorI()
31 DateFormat.MONTH_FIELD, fpos.getField()); in test_ConstructorI()
41 FieldPosition fpos = new FieldPosition(DateFormat.Field.MONTH); in test_ConstructorLjava_text_Format$Field()
43 DateFormat.Field.MONTH, fpos.getFieldAttribute()); in test_ConstructorLjava_text_Format$Field()
53 FieldPosition fpos = new FieldPosition(DateFormat.Field.MONTH, in test_ConstructorLjava_text_Format$FieldI()
54 DateFormat.MONTH_FIELD); in test_ConstructorLjava_text_Format$FieldI()
56 DateFormat.Field.MONTH, fpos.getFieldAttribute()); in test_ConstructorLjava_text_Format$FieldI()
58 DateFormat.MONTH_FIELD, fpos.getField()); in test_ConstructorLjava_text_Format$FieldI()
61 FieldPosition fpos2 = new FieldPosition(DateFormat.Field.HOUR1, in test_ConstructorLjava_text_Format$FieldI()
[all …]
DSimpleDateFormatTest.java19 import java.text.DateFormat;
56 assertTrue("Wrong default", f2.equals(DateFormat.getDateTimeInstance( in test_Constructor()
57 DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault()))); in test_Constructor()
212 SimpleDateFormat format = (SimpleDateFormat) DateFormat.getInstance(); in test_equalsLjava_lang_Object()
227 SimpleDateFormat format = (SimpleDateFormat) DateFormat.getInstance(); in test_hashCode()
263 assertFormat(" G", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
264 assertFormat(" GG", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
265 assertFormat(" GGG", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
267 DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
271 assertFormat(" y", cal, " 1999", DateFormat.YEAR_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
[all …]
DMessageFormatTest.java26 import java.text.DateFormat;
116 f1.setFormat(0, DateFormat.getTimeInstance()); in test_setFormatILjava_text_Format()
117 f1.setFormat(1, DateFormat.getTimeInstance()); in test_setFormatILjava_text_Format()
121 f1.setFormat(5, DateFormat.getTimeInstance()); in test_setFormatILjava_text_Format()
127 DateFormat.getTimeInstance(), in test_setFormatILjava_text_Format()
128 DateFormat.getTimeInstance(), in test_setFormatILjava_text_Format()
132 DateFormat.getTimeInstance() in test_setFormatILjava_text_Format()
142 f1.setFormat(-1, DateFormat.getDateInstance()); in test_setFormatILjava_text_Format()
147 f1.setFormat(f1.getFormats().length, DateFormat.getDateInstance()); in test_setFormatILjava_text_Format()
228 DateFormat.getTimeInstance(), in test_setFormats$Ljava_text_Format()
[all …]
DParseExceptionTest.java19 import java.text.DateFormat;
30 DateFormat df = DateFormat.getInstance(); in test_ConstructorLjava_lang_StringI()
43 DateFormat df = DateFormat.getInstance(); in test_getErrorOffset()
DSupport_MessageFormat.java20 import java.text.DateFormat;
62 t_FormatWithField(2, format, objects, null, DateFormat.Field.AM_PM, 0, in t_format_with_FieldPosition()
68 t_FormatWithField(4, format, objects, null, DateFormat.Field.ERA, 0, 0); in t_format_with_FieldPosition()
86 v.add(new FieldContainer(3, 6, DateFormat.Field.MONTH)); in getMessageVector1()
89 v.add(new FieldContainer(7, 9, DateFormat.Field.DAY_OF_MONTH)); in getMessageVector1()
92 v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR)); in getMessageVector1()
94 v.add(new FieldContainer(19, 20, DateFormat.Field.HOUR1)); in getMessageVector1()
97 v.add(new FieldContainer(21, 23, DateFormat.Field.MINUTE)); in getMessageVector1()
100 v.add(new FieldContainer(24, 26, DateFormat.Field.SECOND)); in getMessageVector1()
103 v.add(new FieldContainer(27, 29, DateFormat.Field.AM_PM)); in getMessageVector1()
DSupport_SimpleDateFormat.java20 import java.text.DateFormat;
23 import java.text.DateFormat.Field;
54 …SimpleDateFormat format = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.DEFAULT, Locale… in t_format_with_FieldPosition()
138 …SimpleDateFormat format = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.DEFAULT, Locale… in t_formatToCharacterIterator()
/libcore/luni/src/test/java/libcore/java/text/
DOldDateFormatTest.java19 import java.text.DateFormat;
31 private class MockDateFormat extends DateFormat {
71 DateFormat format = DateFormat.getInstance(); in test_equalsLjava_lang_Object()
72 DateFormat clone = (DateFormat) format.clone(); in test_equalsLjava_lang_Object()
75 .equals(DateFormat.getTimeInstance())); in test_equalsLjava_lang_Object()
89 DateFormat format = DateFormat.getDateTimeInstance( in test_formatLjava_util_Date()
90 DateFormat.SHORT, DateFormat.SHORT, Locale.US); in test_formatLjava_util_Date()
107 DateFormat format = DateFormat.getDateTimeInstance( in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
108 DateFormat.SHORT, DateFormat.SHORT, Locale.US); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
111 FieldPosition fp = new FieldPosition(DateFormat.YEAR_FIELD); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
[all …]
DAttributedCharacterIteratorAttributeTest.java22 import java.text.DateFormat;
35 assertSameReserialized(DateFormat.Field.ERA); in testSerialization()
36 assertSameReserialized(DateFormat.Field.TIME_ZONE); in testSerialization()
DSimpleDateFormatTest.java19 import java.text.DateFormat;
180 DateFormat dateFormat = new SimpleDateFormat(fmt, l); in formatDate()
367 SimpleDateFormat.getDateInstance(DateFormat.SHORT, null); in test_nullLocales()
372 SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, null); in test_nullLocales()
377 SimpleDateFormat.getTimeInstance(DateFormat.SHORT, null); in test_nullLocales()
384 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, new Locale("sl")); in test_sl_dates()
/libcore/luni/src/main/java/libcore/icu/
DLocaleData.java19 import java.text.DateFormat;
169 case DateFormat.SHORT: in getDateFormat()
171 case DateFormat.MEDIUM: in getDateFormat()
173 case DateFormat.LONG: in getDateFormat()
175 case DateFormat.FULL: in getDateFormat()
183 case DateFormat.SHORT: in getTimeFormat()
184 if (DateFormat.is24Hour == null) { in getTimeFormat()
187 return DateFormat.is24Hour ? timeFormat_Hm : timeFormat_hm; in getTimeFormat()
189 case DateFormat.MEDIUM: in getTimeFormat()
190 if (DateFormat.is24Hour == null) { in getTimeFormat()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DExpensiveObjectsBenchmark.java32 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeNewDateFormatTimeInstance()
38 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeClonedDateFormatTimeInstance()
40 ((DateFormat) df.clone()).format(System.currentTimeMillis()); in timeClonedDateFormatTimeInstance()
45 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeReusedDateFormatTimeInstance()
DDateToStringBenchmark.java19 import android.text.format.DateFormat;
60 DateFormat.format("EEE MMM dd HH:mm:ss zzz yyyy", calendar); in timeDateToString_AndroidDateFormat()
/libcore/luni/src/main/java/java/text/
DDateFormat.java64 public abstract class DateFormat extends Format { class
228 protected DateFormat() { in DateFormat() method in DateFormat
236 DateFormat clone = (DateFormat) super.clone(); in clone()
258 if (!(object instanceof DateFormat)) { in equals()
261 DateFormat dateFormat = (DateFormat) object; in equals()
361 public static final DateFormat getDateInstance() { in getDateInstance()
377 public static final DateFormat getDateInstance(int style) { in getDateInstance()
396 public static final DateFormat getDateInstance(int style, Locale locale) { in getDateInstance()
410 public static final DateFormat getDateTimeInstance() { in getDateTimeInstance()
428 public static final DateFormat getDateTimeInstance(int dateStyle, int timeStyle) { in getDateTimeInstance()
[all …]
DMessageFormat.java574 format = DateFormat.getInstance(); in formatImpl()
977 return type == 1 ? DateFormat.getDateInstance( in parseVariable()
978 DateFormat.DEFAULT, locale) : DateFormat in parseVariable()
979 .getTimeInstance(DateFormat.DEFAULT, locale); in parseVariable()
989 dateStyle = DateFormat.FULL; in parseVariable()
992 dateStyle = DateFormat.LONG; in parseVariable()
995 dateStyle = DateFormat.MEDIUM; in parseVariable()
998 dateStyle = DateFormat.SHORT; in parseVariable()
1001 return type == 1 ? DateFormat in parseVariable()
1002 .getDateInstance(dateStyle, locale) : DateFormat in parseVariable()
[all …]
DSimpleDateFormat.java197 public class SimpleDateFormat extends DateFormat {
/libcore/luni/src/main/java/libcore/net/http/
DHttpDate.java19 import java.text.DateFormat;
35 private static final ThreadLocal<DateFormat> STANDARD_DATE_FORMAT
36 = new ThreadLocal<DateFormat>() {
37 @Override protected DateFormat initialValue() {
38 DateFormat rfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
/libcore/support/src/test/java/tests/support/
DSupport_MessageFormat.java20 import java.text.DateFormat;
61 t_FormatWithField(2, format, objects, null, DateFormat.Field.AM_PM, 0, in t_format_with_FieldPosition()
67 t_FormatWithField(4, format, objects, null, DateFormat.Field.ERA, 0, 0); in t_format_with_FieldPosition()
88 v.add(new FieldContainer(3, 6, DateFormat.Field.MONTH)); in getMessageVector1()
91 v.add(new FieldContainer(7, 9, DateFormat.Field.DAY_OF_MONTH)); in getMessageVector1()
94 v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR)); in getMessageVector1()
96 v.add(new FieldContainer(19, 20, DateFormat.Field.HOUR1)); in getMessageVector1()
99 v.add(new FieldContainer(21, 23, DateFormat.Field.MINUTE)); in getMessageVector1()
102 v.add(new FieldContainer(24, 26, DateFormat.Field.SECOND)); in getMessageVector1()
105 v.add(new FieldContainer(27, 29, DateFormat.Field.AM_PM)); in getMessageVector1()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DSerializationStressTest4.java29 import java.text.DateFormat;
599 objToSave = new java.text.DateFormat() { in test_writeObject_DateFormat()
619 if (!(obj instanceof java.text.DateFormat)) in test_writeObject_DateFormat()
621 return save.equals(((java.text.DateFormat) obj).parse(null, in test_writeObject_DateFormat()
1757 DateFormat.Field[] objToSave = null; in test_writeObject_DateFormat_Field()
1758 DateFormat.Field[] objLoaded = null; in test_writeObject_DateFormat_Field()
1761 objToSave = new DateFormat.Field[] { DateFormat.Field.AM_PM, in test_writeObject_DateFormat_Field()
1762 DateFormat.Field.DAY_OF_MONTH, DateFormat.Field.ERA, in test_writeObject_DateFormat_Field()
1763 DateFormat.Field.HOUR0, DateFormat.Field.HOUR1, in test_writeObject_DateFormat_Field()
1764 DateFormat.Field.HOUR_OF_DAY0, in test_writeObject_DateFormat_Field()
[all …]
DSerializationStressTest.java139 static final java.text.DateFormat DATEFORM = java.text.DateFormat
/libcore/luni/src/main/java/java/util/
DDate.java24 import java.text.DateFormat;
687 return DateFormat.getDateTimeInstance().format(this); in toLocaleString()
/libcore/luni/src/test/java/libcore/java/util/
DLocaleTest.java21 import java.text.DateFormat;
172 assertOnce(newLocale, DateFormat.getAvailableLocales()); in assertObsolete()