Lines Matching defs:format

69  * <p>{@code DateFormat} helps you to format and parse dates for any locale.
71 * months, days of the week, or even the calendar format: lunar vs. solar.
73 * <p>To format a date for the current Locale, use one of the
76 * myString = DateFormat.getDateInstance().format(myDate);
79 * more efficient to get the format and use it multiple times so that
85 * output.println(df.format(myDate[i]) + "; ");
88 * <p>To format a date for a different Locale, specify it in the
97 * <p>Use {@code getDateInstance} to get the normal date format for that country.
99 * Use {@code getTimeInstance} to get the time format for that country.
100 * Use {@code getDateTimeInstance} to get a date and time format. You can pass in
111 * <p>You can also set the time zone on the format if you wish.
112 * If you want even more control over the format or parsing,
119 * <p>You can also use forms of the parse and format methods with
131 * It is recommended to create separate format instances for each thread.
132 * If multiple threads access a format concurrently, it must be synchronized
158 * The number formatter that <code>DateFormat</code> uses to format numbers
159 * in dates and times. Subclasses should initialize this to a number format
292 public final StringBuffer format(Object obj, StringBuffer toAppendTo,
296 return format( (Date)obj, toAppendTo, fieldPosition );
298 return format( new Date(((Number)obj).longValue()),
301 throw new IllegalArgumentException("Cannot format given Object as a Date");
326 public abstract StringBuffer format(Date date, StringBuffer toAppendTo,
334 public final String format(Date date)
336 return format(date, new StringBuffer(),
368 * by this object's format method but can still be parsed as a date, then
370 * format by calling {@link #setLenient(boolean) setLenient(false)}.
579 * Set the calendar to be used by this date format. Initially, the default
586 * @param newCalendar the new {@code Calendar} to be used by the date format
614 * format and parse a time.
659 * do not precisely match this object's format. With strict parsing,
660 * inputs must match this object's format.
731 * @param timeStyle a value from 0 to 3 indicating the time format,
733 * @param dateStyle a value from 0 to 3 indicating the time format,
735 * @param flags either 1 for a time format, 2 for a date format,
736 * or 3 for a date/time format
737 * @param loc the locale for the format
779 * Create a new date format.