android.text.format
Class DateUtils
java.lang.Object
android.text.format.DateUtils
public class DateUtils
- extends Object
Method Summary |
static Formatter |
formatDateRange(Context context,
Formatter formatter,
long startMillis,
long endMillis,
int flags)
|
static Formatter |
formatDateRange(Context context,
Formatter formatter,
long startMillis,
long endMillis,
int flags,
String timeZone)
|
static String |
formatDateRange(Context context,
long startMillis,
long endMillis,
int flags)
|
static String |
formatDateTime(Context context,
long millis,
int flags)
|
static String |
formatElapsedTime(long elapsedSeconds)
|
static String |
formatElapsedTime(StringBuilder recycle,
long elapsedSeconds)
|
static CharSequence |
formatSameDayTime(long then,
long now,
int dateStyle,
int timeStyle)
|
static String |
getAMPMString(int ampm)
|
static String |
getDayOfWeekString(int dayOfWeek,
int abbrev)
|
static String |
getMonthString(int month,
int abbrev)
|
static CharSequence |
getRelativeDateTimeString(Context c,
long time,
long minResolution,
long transitionResolution,
int flags)
|
static CharSequence |
getRelativeTimeSpanString(Context c,
long millis)
|
static CharSequence |
getRelativeTimeSpanString(Context c,
long millis,
boolean withPreposition)
|
static CharSequence |
getRelativeTimeSpanString(long startTime)
|
static CharSequence |
getRelativeTimeSpanString(long time,
long now,
long minResolution)
|
static CharSequence |
getRelativeTimeSpanString(long time,
long now,
long minResolution,
int flags)
|
static boolean |
isToday(long when)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SECOND_IN_MILLIS
public static final long SECOND_IN_MILLIS
- See Also:
- Constant Field Values
MINUTE_IN_MILLIS
public static final long MINUTE_IN_MILLIS
- See Also:
- Constant Field Values
HOUR_IN_MILLIS
public static final long HOUR_IN_MILLIS
- See Also:
- Constant Field Values
DAY_IN_MILLIS
public static final long DAY_IN_MILLIS
- See Also:
- Constant Field Values
WEEK_IN_MILLIS
public static final long WEEK_IN_MILLIS
- See Also:
- Constant Field Values
YEAR_IN_MILLIS
public static final long YEAR_IN_MILLIS
- See Also:
- Constant Field Values
FORMAT_SHOW_TIME
public static final int FORMAT_SHOW_TIME
- See Also:
- Constant Field Values
FORMAT_SHOW_WEEKDAY
public static final int FORMAT_SHOW_WEEKDAY
- See Also:
- Constant Field Values
FORMAT_SHOW_YEAR
public static final int FORMAT_SHOW_YEAR
- See Also:
- Constant Field Values
FORMAT_NO_YEAR
public static final int FORMAT_NO_YEAR
- See Also:
- Constant Field Values
FORMAT_SHOW_DATE
public static final int FORMAT_SHOW_DATE
- See Also:
- Constant Field Values
FORMAT_NO_MONTH_DAY
public static final int FORMAT_NO_MONTH_DAY
- See Also:
- Constant Field Values
FORMAT_12HOUR
public static final int FORMAT_12HOUR
- See Also:
- Constant Field Values
FORMAT_24HOUR
public static final int FORMAT_24HOUR
- See Also:
- Constant Field Values
FORMAT_CAP_AMPM
public static final int FORMAT_CAP_AMPM
- See Also:
- Constant Field Values
FORMAT_NO_NOON
public static final int FORMAT_NO_NOON
- See Also:
- Constant Field Values
FORMAT_CAP_NOON
public static final int FORMAT_CAP_NOON
- See Also:
- Constant Field Values
FORMAT_NO_MIDNIGHT
public static final int FORMAT_NO_MIDNIGHT
- See Also:
- Constant Field Values
FORMAT_CAP_MIDNIGHT
public static final int FORMAT_CAP_MIDNIGHT
- See Also:
- Constant Field Values
FORMAT_UTC
public static final int FORMAT_UTC
- See Also:
- Constant Field Values
FORMAT_ABBREV_TIME
public static final int FORMAT_ABBREV_TIME
- See Also:
- Constant Field Values
FORMAT_ABBREV_WEEKDAY
public static final int FORMAT_ABBREV_WEEKDAY
- See Also:
- Constant Field Values
FORMAT_ABBREV_MONTH
public static final int FORMAT_ABBREV_MONTH
- See Also:
- Constant Field Values
FORMAT_NUMERIC_DATE
public static final int FORMAT_NUMERIC_DATE
- See Also:
- Constant Field Values
FORMAT_ABBREV_RELATIVE
public static final int FORMAT_ABBREV_RELATIVE
- See Also:
- Constant Field Values
FORMAT_ABBREV_ALL
public static final int FORMAT_ABBREV_ALL
- See Also:
- Constant Field Values
FORMAT_CAP_NOON_MIDNIGHT
public static final int FORMAT_CAP_NOON_MIDNIGHT
- See Also:
- Constant Field Values
FORMAT_NO_NOON_MIDNIGHT
public static final int FORMAT_NO_NOON_MIDNIGHT
- See Also:
- Constant Field Values
HOUR_MINUTE_24
public static final String HOUR_MINUTE_24
- See Also:
- Constant Field Values
MONTH_FORMAT
public static final String MONTH_FORMAT
- See Also:
- Constant Field Values
ABBREV_MONTH_FORMAT
public static final String ABBREV_MONTH_FORMAT
- See Also:
- Constant Field Values
NUMERIC_MONTH_FORMAT
public static final String NUMERIC_MONTH_FORMAT
- See Also:
- Constant Field Values
MONTH_DAY_FORMAT
public static final String MONTH_DAY_FORMAT
- See Also:
- Constant Field Values
YEAR_FORMAT
public static final String YEAR_FORMAT
- See Also:
- Constant Field Values
YEAR_FORMAT_TWO_DIGITS
public static final String YEAR_FORMAT_TWO_DIGITS
- See Also:
- Constant Field Values
WEEKDAY_FORMAT
public static final String WEEKDAY_FORMAT
- See Also:
- Constant Field Values
ABBREV_WEEKDAY_FORMAT
public static final String ABBREV_WEEKDAY_FORMAT
- See Also:
- Constant Field Values
sameYearTable
public static final int[] sameYearTable
sameMonthTable
public static final int[] sameMonthTable
LENGTH_LONG
public static final int LENGTH_LONG
- See Also:
- Constant Field Values
LENGTH_MEDIUM
public static final int LENGTH_MEDIUM
- See Also:
- Constant Field Values
LENGTH_SHORT
public static final int LENGTH_SHORT
- See Also:
- Constant Field Values
LENGTH_SHORTER
public static final int LENGTH_SHORTER
- See Also:
- Constant Field Values
LENGTH_SHORTEST
public static final int LENGTH_SHORTEST
- See Also:
- Constant Field Values
DateUtils
public DateUtils()
getDayOfWeekString
public static String getDayOfWeekString(int dayOfWeek,
int abbrev)
getAMPMString
public static String getAMPMString(int ampm)
getMonthString
public static String getMonthString(int month,
int abbrev)
getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(long startTime)
getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(long time,
long now,
long minResolution)
getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(long time,
long now,
long minResolution,
int flags)
getRelativeDateTimeString
public static CharSequence getRelativeDateTimeString(Context c,
long time,
long minResolution,
long transitionResolution,
int flags)
formatElapsedTime
public static String formatElapsedTime(long elapsedSeconds)
formatElapsedTime
public static String formatElapsedTime(StringBuilder recycle,
long elapsedSeconds)
formatSameDayTime
public static final CharSequence formatSameDayTime(long then,
long now,
int dateStyle,
int timeStyle)
isToday
public static boolean isToday(long when)
formatDateRange
public static String formatDateRange(Context context,
long startMillis,
long endMillis,
int flags)
formatDateRange
public static Formatter formatDateRange(Context context,
Formatter formatter,
long startMillis,
long endMillis,
int flags)
formatDateRange
public static Formatter formatDateRange(Context context,
Formatter formatter,
long startMillis,
long endMillis,
int flags,
String timeZone)
formatDateTime
public static String formatDateTime(Context context,
long millis,
int flags)
getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(Context c,
long millis,
boolean withPreposition)
getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(Context c,
long millis)
Copyright © 2008-2012. All Rights Reserved.