android.text.format
Class DateUtils
java.lang.Object
android.text.format.DateUtils
public class DateUtils
- extends java.lang.Object
|
Method Summary |
static java.util.Formatter |
formatDateRange(Context context,
java.util.Formatter formatter,
long startMillis,
long endMillis,
int flags)
|
static java.lang.String |
formatDateRange(Context context,
long startMillis,
long endMillis,
int flags)
|
static java.lang.String |
formatDateTime(Context context,
long millis,
int flags)
|
static java.lang.String |
formatElapsedTime(long elapsedSeconds)
|
static java.lang.String |
formatElapsedTime(java.lang.StringBuilder recycle,
long elapsedSeconds)
|
static java.lang.CharSequence |
formatSameDayTime(long then,
long now,
int dateStyle,
int timeStyle)
|
static java.lang.String |
getAMPMString(int ampm)
|
static java.lang.String |
getDayOfWeekString(int dayOfWeek,
int abbrev)
|
static java.lang.String |
getMonthString(int month,
int abbrev)
|
static java.lang.CharSequence |
getRelativeDateTimeString(Context c,
long time,
long minResolution,
long transitionResolution,
int flags)
|
static java.lang.CharSequence |
getRelativeTimeSpanString(Context c,
long millis)
|
static java.lang.CharSequence |
getRelativeTimeSpanString(Context c,
long millis,
boolean withPreposition)
|
static java.lang.CharSequence |
getRelativeTimeSpanString(long startTime)
|
static java.lang.CharSequence |
getRelativeTimeSpanString(long time,
long now,
long minResolution)
|
static java.lang.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 java.lang.String HOUR_MINUTE_24
- See Also:
- Constant Field Values
MONTH_FORMAT
public static final java.lang.String MONTH_FORMAT
- See Also:
- Constant Field Values
ABBREV_MONTH_FORMAT
public static final java.lang.String ABBREV_MONTH_FORMAT
- See Also:
- Constant Field Values
NUMERIC_MONTH_FORMAT
public static final java.lang.String NUMERIC_MONTH_FORMAT
- See Also:
- Constant Field Values
MONTH_DAY_FORMAT
public static final java.lang.String MONTH_DAY_FORMAT
- See Also:
- Constant Field Values
YEAR_FORMAT
public static final java.lang.String YEAR_FORMAT
- See Also:
- Constant Field Values
YEAR_FORMAT_TWO_DIGITS
public static final java.lang.String YEAR_FORMAT_TWO_DIGITS
- See Also:
- Constant Field Values
WEEKDAY_FORMAT
public static final java.lang.String WEEKDAY_FORMAT
- See Also:
- Constant Field Values
ABBREV_WEEKDAY_FORMAT
public static final java.lang.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 java.lang.String getDayOfWeekString(int dayOfWeek,
int abbrev)
getAMPMString
public static java.lang.String getAMPMString(int ampm)
getMonthString
public static java.lang.String getMonthString(int month,
int abbrev)
getRelativeTimeSpanString
public static java.lang.CharSequence getRelativeTimeSpanString(long startTime)
getRelativeTimeSpanString
public static java.lang.CharSequence getRelativeTimeSpanString(long time,
long now,
long minResolution)
getRelativeTimeSpanString
public static java.lang.CharSequence getRelativeTimeSpanString(long time,
long now,
long minResolution,
int flags)
getRelativeDateTimeString
public static java.lang.CharSequence getRelativeDateTimeString(Context c,
long time,
long minResolution,
long transitionResolution,
int flags)
formatElapsedTime
public static java.lang.String formatElapsedTime(long elapsedSeconds)
formatElapsedTime
public static java.lang.String formatElapsedTime(java.lang.StringBuilder recycle,
long elapsedSeconds)
formatSameDayTime
public static final java.lang.CharSequence formatSameDayTime(long then,
long now,
int dateStyle,
int timeStyle)
isToday
public static boolean isToday(long when)
formatDateRange
public static java.lang.String formatDateRange(Context context,
long startMillis,
long endMillis,
int flags)
formatDateRange
public static java.util.Formatter formatDateRange(Context context,
java.util.Formatter formatter,
long startMillis,
long endMillis,
int flags)
formatDateTime
public static java.lang.String formatDateTime(Context context,
long millis,
int flags)
getRelativeTimeSpanString
public static java.lang.CharSequence getRelativeTimeSpanString(Context c,
long millis,
boolean withPreposition)
getRelativeTimeSpanString
public static java.lang.CharSequence getRelativeTimeSpanString(Context c,
long millis)
Copyright © 2008-2010. All Rights Reserved.