Android.Widget.TextClock Class

See Also: TextClock Members

Syntax

[Android.Runtime.Register("android/widget/TextClock", DoNotGenerateAcw=true)]
public class TextClock : TextView

Remarks

TextClock can display the current date and/or time as a formatted string.

This view honors the 24-hour format system setting. As such, it is possible and recommended to provide two different formatting patterns: one to display the date/time in 24-hour mode and one to display the date/time in 12-hour mode. Most callers will want to use the defaults, though, which will be appropriate for the user's locale.

It is possible to determine whether the system is currently in 24-hour mode by calling TextClock.Is24HourModeEnabled.

The rules used by this widget to decide how to format the date and time are the following:

The Java.Lang.ICharSequence instances used as formatting patterns when calling either TextClock.Format24HourFormatted or TextClock.Format12HourFormatted can contain styling information. To do so, use a Android.Text.ISpanned object. Note that if you customize these strings, it is your responsibility to supply strings appropriate for formatting dates and/or times in the user's locale.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 17