DateUtils DateUtils Class

Definition

This class contains various date-related utilities for creating text for things like elapsed time and date ranges, strings for days of the week and months, and AM/PM text etc.

[Android.Runtime.Register("android/text/format/DateUtils", ApiSince=3, DoNotGenerateAcw=true)]
public class DateUtils : Java.Lang.Object
type DateUtils = class
    inherit Object
Inheritance
DateUtilsDateUtils
Attributes

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

DateUtils() DateUtils()
DateUtils(IntPtr, JniHandleOwnership) DateUtils(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

AbbrevMonthFormat AbbrevMonthFormat

This is not actually a useful month name in all locales.

AbbrevWeekdayFormat AbbrevWeekdayFormat
DayInMillis DayInMillis
HourInMillis HourInMillis
HourMinute24 HourMinute24

This is not actually the preferred 24-hour date format in all locales.

MinuteInMillis MinuteInMillis
MonthDayFormat MonthDayFormat
MonthFormat MonthFormat
NumericMonthFormat NumericMonthFormat
SecondInMillis SecondInMillis
WeekdayFormat WeekdayFormat
WeekInMillis WeekInMillis
YearFormat YearFormat
YearFormatTwoDigits YearFormatTwoDigits
YearInMillis YearInMillis

This constant is actually the length of 364 days, not of a year!

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
SameMonthTable SameMonthTable
SameYearTable SameYearTable
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
FormatDateRange(Context, Formatter, Int64, Int64, FormatStyleFlags) FormatDateRange(Context, Formatter, Int64, Int64, FormatStyleFlags)

Formats a date or a time range according to the local conventions.

FormatDateRange(Context, Formatter, Int64, Int64, FormatStyleFlags, String) FormatDateRange(Context, Formatter, Int64, Int64, FormatStyleFlags, String)

Formats a date or a time range according to the local conventions.

FormatDateRange(Context, Int64, Int64, FormatStyleFlags) FormatDateRange(Context, Int64, Int64, FormatStyleFlags)

Formats a date or a time range according to the local conventions.

FormatDateTime(Context, Int64, FormatStyleFlags) FormatDateTime(Context, Int64, FormatStyleFlags)

Formats a date or a time according to the local conventions.

FormatElapsedTime(Int64) FormatElapsedTime(Int64)

Formats an elapsed time in the form "MM:SS" or "H:MM:SS" for display on the call-in-progress screen.

FormatElapsedTime(StringBuilder, Int64) FormatElapsedTime(StringBuilder, Int64)

Formats an elapsed time in a format like "MM:SS" or "H:MM:SS" (using a form suited to the current locale), similar to that used on the call-in-progress screen.

FormatSameDayTime(Int64, Int64, AbbreviationLength, AbbreviationLength) FormatSameDayTime(Int64, Int64, AbbreviationLength, AbbreviationLength)
FormatSameDayTime(Int64, Int64, Int32, Int32) FormatSameDayTime(Int64, Int64, Int32, Int32)
FormatSameDayTimeFormatted(Int64, Int64, AbbreviationLength, AbbreviationLength) FormatSameDayTimeFormatted(Int64, Int64, AbbreviationLength, AbbreviationLength)

Format a date / time such that if the then is on the same day as now, it shows just the time and if it's a different day, it shows just the date.

FormatSameDayTimeFormatted(Int64, Int64, Int32, Int32) FormatSameDayTimeFormatted(Int64, Int64, Int32, Int32)
GetAMPMString(Int32) GetAMPMString(Int32)

Return a localized string for AM or PM.

GetDayOfWeekString(Int32, AbbreviationLength) GetDayOfWeekString(Int32, AbbreviationLength)

Return a string for the day of the week.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetMonthString(Int32, AbbreviationLength) GetMonthString(Int32, AbbreviationLength)

Return a localized string for the month of the year.

GetRelativeDateTimeString(Context, Int64, Int64, Int64, FormatStyleFlags) GetRelativeDateTimeString(Context, Int64, Int64, Int64, FormatStyleFlags)
GetRelativeDateTimeStringFormatted(Context, Int64, Int64, Int64, FormatStyleFlags) GetRelativeDateTimeStringFormatted(Context, Int64, Int64, Int64, FormatStyleFlags)

Return string describing the elapsed time since startTime formatted like "[relative time/date], [time]".

GetRelativeTimeSpanString(Context, Int64) GetRelativeTimeSpanString(Context, Int64)
GetRelativeTimeSpanString(Context, Int64, Boolean) GetRelativeTimeSpanString(Context, Int64, Boolean)
GetRelativeTimeSpanString(Int64) GetRelativeTimeSpanString(Int64)
GetRelativeTimeSpanString(Int64, Int64, Int64) GetRelativeTimeSpanString(Int64, Int64, Int64)
GetRelativeTimeSpanString(Int64, Int64, Int64, FormatStyleFlags) GetRelativeTimeSpanString(Int64, Int64, Int64, FormatStyleFlags)
GetRelativeTimeSpanStringFormatted(Context, Int64) GetRelativeTimeSpanStringFormatted(Context, Int64)

Convenience function to return relative time string without preposition.

GetRelativeTimeSpanStringFormatted(Context, Int64, Boolean) GetRelativeTimeSpanStringFormatted(Context, Int64, Boolean)
GetRelativeTimeSpanStringFormatted(Int64) GetRelativeTimeSpanStringFormatted(Int64)

Returns a string describing the elapsed time since startTime.

GetRelativeTimeSpanStringFormatted(Int64, Int64, Int64) GetRelativeTimeSpanStringFormatted(Int64, Int64, Int64)

Returns a string describing 'time' as a time relative to 'now'.

GetRelativeTimeSpanStringFormatted(Int64, Int64, Int64, FormatStyleFlags) GetRelativeTimeSpanStringFormatted(Int64, Int64, Int64, FormatStyleFlags)

Returns a string describing 'time' as a time relative to 'now'.

IsToday(Int64) IsToday(Int64)
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to