Android.Text.Format.DateUtils.FormatDateTime Method
Formats a date or a time according to the local conventions.

Syntax

[Android.Runtime.Register("formatDateTime", "(Landroid/content/Context;JI)Ljava/lang/String;", "")]
public static string FormatDateTime (Android.Content.Context context, long millis, [Android.Runtime.GeneratedEnum] FormatStyleFlags flags)

Parameters

context
the context is required only if the time is shown
millis
a point in time in UTC milliseconds
flags
a bit mask of formatting options

Returns

Documentation for this section has not yet been entered.

Remarks

Formats a date or a time according to the local conventions. There are lots of options that allow the caller to control, for example, if the time is shown, if the day of the week is shown, if the month name is abbreviated, if noon is shown instead of 12pm, and so on. For the complete list of options, see the documentation for DateUtils.FormatDateRange(Android.Content.Context, Java.Util.Formatter, Java.Util.Formatter, Java.Util.Formatter, Java.Util.Formatter).

Example output strings (date formats in these examples are shown using the US date format convention but that may change depending on the local settings):

  • 10:15am
  • 3:00pm
  • 3pm
  • 3PM
  • 08:00
  • 17:00
  • noon
  • Noon
  • midnight
  • Midnight
  • Oct 31
  • Oct 31, 2007
  • October 31, 2007
  • 10am, Oct 31
  • 17:00, Oct 31
  • Wed
  • Wednesday
  • 10am, Wed, Oct 31
  • Wed, Oct 31
  • Wednesday, Oct 31
  • Wed, Oct 31, 2007
  • Wed, October 31
  • 10/31/2007

[Android Documentation]

Requirements

Namespace: Android.Text.Format
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3