public class FastDateFormat extends Format implements DateParser, DatePrinter
Format.Field| Modifier | Constructor and Description |
|---|---|
protected |
FastDateFormat(String pattern,
TimeZone timeZone,
Locale locale) |
protected |
FastDateFormat(String pattern,
TimeZone timeZone,
Locale locale,
Date centuryStart) |
clone, format, formatToCharacterIterator, parseObjectpublic static FastDateFormat getInstance()
public static FastDateFormat getInstance(String pattern)
public static FastDateFormat getInstance(String pattern, TimeZone timeZone)
public static FastDateFormat getInstance(String pattern, Locale locale)
public static FastDateFormat getInstance(String pattern, TimeZone timeZone, Locale locale)
pattern - patterntimeZone - timeZonelocale - localepublic static FastDateFormat getDateInstance(int style)
public static FastDateFormat getDateInstance(int style, Locale locale)
public static FastDateFormat getDateInstance(int style, TimeZone timeZone)
public static FastDateFormat getDateInstance(int style, TimeZone timeZone, Locale locale)
style - styletimeZone - timeZonelocale - localepublic static FastDateFormat getTimeInstance(int style)
public static FastDateFormat getTimeInstance(int style, Locale locale)
public static FastDateFormat getTimeInstance(int style, TimeZone timeZone)
public static FastDateFormat getTimeInstance(int style, TimeZone timeZone, Locale locale)
style - styletimeZone - timeZonelocale - localepublic static FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle)
public static FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)
public static FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle, TimeZone timeZone)
public static FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle, TimeZone timeZone, Locale locale)
dateStyle - dateStyletimeStyle - timeStyletimeZone - timeZonelocale - localepublic StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
public String format(long millis)
DatePrinterformat in interface DatePrintermillis - 毫秒public String format(Date date)
DatePrinterformat in interface DatePrinterdate - 时间public String format(Calendar calendar)
DatePrinterformat in interface DatePrintercalendar - calendarpublic Date parse(String source)
DateParserparse in interface DateParsersource - 时间public Date parse(String source, ParsePosition pos)
DateParserparse in interface DateParsersource - 时间pos - 位置public boolean parse(String source, ParsePosition pos, Calendar calendar)
DateParserparse in interface DateParsersource - 时间pos - 位置calendar - 日历public Object parseObject(String source, ParsePosition pos)
parseObject in class Formatpublic String getPattern()
DateParsergetPattern in interface DateParsergetPattern in interface DatePrinterpublic TimeZone getTimeZone()
DateParsergetTimeZone in interface DateParsergetTimeZone in interface DatePrinterpublic Locale getLocale()
DateParsergetLocale in interface DateParsergetLocale in interface DatePrinterpublic int getMaxLengthEstimate()
Copyright © 2025. All rights reserved.