DateTimeFormatterBuilder Class

Definition

Builder to create date-time formatters.

[Android.Runtime.Register("java/time/format/DateTimeFormatterBuilder", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class DateTimeFormatterBuilder : Java.Lang.Object
[<Android.Runtime.Register("java/time/format/DateTimeFormatterBuilder", ApiSince=26, DoNotGenerateAcw=true)>]
type DateTimeFormatterBuilder = class
    inherit Object
Inheritance
DateTimeFormatterBuilder
Attributes

Remarks

Builder to create date-time formatters.

This allows a DateTimeFormatter to be created. All date-time formatters are created ultimately using this builder.

The basic elements of date-time can all be added: <ul> <li>Value - a numeric value</li> <li>Fraction - a fractional value including the decimal place. Always use this when outputting fractions to ensure that the fraction is parsed correctly</li> <li>Text - the textual equivalent for the value</li> <li>OffsetId/Offset - the ZoneOffset zone offset</li> <li>ZoneId - the ZoneId time-zone id</li> <li>ZoneText - the name of the time-zone</li> <li>ChronologyId - the Chronology chronology id</li> <li>ChronologyText - the name of the chronology</li> <li>Literal - a text literal</li> <li>Nested and Optional - formats can be nested or made optional</li> </ul> In addition, any of the elements may be decorated by padding, either with spaces or any other character.

Finally, a shorthand pattern, mostly compatible with java.text.SimpleDateFormat SimpleDateFormat can be used, see #appendPattern(String). In practice, this simply parses the pattern and calls other methods on the builder.

Added in 1.8.

Java documentation for java.time.format.DateTimeFormatterBuilder.

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

Name Description
DateTimeFormatterBuilder()

Constructs a new instance of the builder.

Properties

Name Description
Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers
PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
ThresholdClass

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

(Inherited from Object)
ThresholdType

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

(Inherited from Object)

Methods

Name Description
Append(DateTimeFormatter)

Appends all the elements of a formatter to the builder.

AppendChronologyId()

Appends the chronology ID, such as 'ISO' or 'ThaiBuddhist', to the formatter.

AppendChronologyText(TextStyle)

Appends the chronology name to the formatter.

AppendFraction(ITemporalField, Int32, Int32, Boolean)

Appends the fractional value of a date-time field to the formatter.

AppendGenericZoneText(TextStyle, ICollection<ZoneId>)

Appends the generic time-zone name, such as 'Pacific Time', to the formatter.

AppendGenericZoneText(TextStyle)

Appends the generic time-zone name, such as 'Pacific Time', to the formatter.

AppendInstant()

Appends an instant using ISO-8601 to the formatter, formatting fractional digits in groups of three.

AppendInstant(Int32)

Appends an instant using ISO-8601 to the formatter with control over the number of fractional digits.

AppendLiteral(Char)

Appends a character literal to the formatter.

AppendLiteral(String)

Appends a string literal to the formatter.

AppendLocalized(FormatStyle, FormatStyle)

Appends a localized date-time pattern to the formatter.

AppendLocalizedOffset(TextStyle)

Appends the localized zone offset, such as 'GMT+01:00', to the formatter.

AppendOffset(String, String)

Appends the zone offset, such as '+01:00', to the formatter.

AppendOffsetId()

Appends the zone offset, such as '+01:00', to the formatter.

AppendOptional(DateTimeFormatter)

Appends a formatter to the builder which will optionally format/parse.

AppendPattern(String)

Appends the elements defined by the specified pattern to the builder.

AppendText(ITemporalField, IDictionary<Long,String>)

Appends the text of a date-time field to the formatter using a provided mapping.

AppendText(ITemporalField, TextStyle)

Appends the text of a date-time field to the formatter.

AppendText(ITemporalField)

Appends the text of a date-time field to the formatter using the full text style.

AppendValue(ITemporalField, Int32, Int32, SignStyle)

Appends the value of a date-time field to the formatter.

AppendValue(ITemporalField, Int32)

Appends the value of a date-time field to the formatter using a fixed width, zero-padded number.

AppendValue(ITemporalField)

Appends the value of a date-time field to the formatter using a normal output style.

AppendValueReduced(ITemporalField, Int32, Int32, IChronoLocalDate)

Appends the reduced value of a date-time field to the formatter.

AppendValueReduced(ITemporalField, Int32, Int32, Int32)

Appends the reduced value of a date-time field to the formatter.

AppendZoneId()

Appends the time-zone ID, such as 'Europe/Paris' or '+02:00', to the formatter.

AppendZoneOrOffsetId()

Appends the time-zone ID, such as 'Europe/Paris' or '+02:00', to the formatter, using the best available zone ID.

AppendZoneRegionId()

Appends the time-zone region ID, such as 'Europe/Paris', to the formatter, rejecting the zone ID if it is a ZoneOffset.

AppendZoneText(TextStyle, ICollection<ZoneId>)

Appends the time-zone name, such as 'British Summer Time', to the formatter.

AppendZoneText(TextStyle)

Appends the time-zone name, such as 'British Summer Time', to the formatter.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
Equals(Object) (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetLocalizedDateTimePattern(FormatStyle, FormatStyle, IChronology, Locale)

Gets the formatting pattern for a localized date and time style.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OptionalEnd()

Ends an optional section.

OptionalStart()

Mark the start of an optional section.

PadNext(Int32, Char)

Causes the next added printer/parser to pad to a fixed width.

PadNext(Int32)

Causes the next added printer/parser to pad to a fixed width using a space.

ParseCaseInsensitive()

Changes the parse style to be case insensitive for the remainder of the formatter.

ParseCaseSensitive()

Changes the parse style to be case sensitive for the remainder of the formatter.

ParseDefaulting(ITemporalField, Int64)

Appends a default value for a date-time field to the formatter.

ParseLenient()

Changes the parse style to be lenient for the remainder of the formatter.

ParseStrict()

Changes the parse style to be strict for the remainder of the formatter.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToFormatter()

Completes this builder by creating the DateTimeFormatter using the default locale.

ToFormatter(Locale)

Completes this builder by creating the DateTimeFormatter using the specified locale.

ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to