Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

DateTimeFormat

class DateTimeFormat

Module: System.Globalization
Assembly: System.Runtime.dll
Source file: DateTimeFormat.rvn

Inheritance: Object → DateTimeFormat

Provisional explicit civil formatting with independent culture and calendar.

Properties

11 items
AMDesignator: string Morning designator used by the US twelve-hour profile; empty for 24-hour profiles.
Calendar: Calendar The explicitly selected calendar; independent of culture.
Culture: Culture The explicitly selected formatting culture.
DateSeparator: string Separator used between numeric date fields. Hebrew-letter dates use spaces instead.
DateTimeSeparator: string Separator between date and time in the default civil representation.
FractionalSecondSeparator: string Separator before fractional seconds in the default time representation.
Static member: Invariant: DateTimeFormat Invariant Gregorian formatter; yyyy-MM-dd and HH:mm:ss.fffffff with T.
LongTimePattern: string Supported long-time pattern for the T specifier, without fractions.
PMDesignator: string Afternoon designator used by the US twelve-hour profile; empty for 24-hour profiles.
ShortTimePattern: string Supported short-time pattern. Custom pattern interpretation is not yet provided.
TimeSeparator: string Separator between hour, minute and second fields.

Methods

12 items
Static member: Create(culture: Culture, calendar: Calendar) -> DateTimeFormat Selects culture and calendar independently. Both supported calendars are accepted.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
FormatDate(date: Date, format: string) -> Result<string, InvalidDateError> Supports empty/G/d for the selected numeric date, and O/o for invariant Gregorian yyyy-MM-dd. Other specifiers fault. Selected-calendar range failures retain InvalidDateError.
FormatDate(date: Date) -> Result<string, InvalidDateError> Formats calendar fields using the selected culture; Hebrew-calendar he-IL uses Hebrew letters.
FormatLocalDateTime(value: LocalDateTime, format: string) -> Result<string, InvalidDateError> Supports empty/G for the selected civil conventions, O/o for invariant seven-digit precision, and s for invariant yyyy-MM-ddTHH:mm:ss. No format adds an offset or a zone. Other spe…
FormatLocalDateTime(value: LocalDateTime) -> Result<string, InvalidDateError> Invariant uses T; named cultures use a space. No offset or timezone is implied.
FormatTime(time: TimeOfDay, format: string) -> string Supports empty/G for existing culture precision, O/o for invariant seven-digit precision, T/t use LongTimePattern/ShortTimePattern (US twelve-hour, otherwise 24-hour). Other specif…
FormatTime(time: TimeOfDay) -> string Formats seven fractional digits; US uses a twelve-hour clock and AM/PM. Other profiles use a 24-hour clock; Swedish uses a decimal comma.
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString
WithCalendar(calendar: Calendar) -> DateTimeFormat Creates a formatter preserving this culture and selecting another calendar. The original is unchanged.