DateTimeFormatInfo
struct · ferroui-base · v0.5.0
struct DateTimeFormatInfo
The date and time conventions of a culture.
The instances handed out by CultureInfo::date_time_format are shared
and read-only; to change conventions clone the value, use the setters and
attach it to a culture with CultureInfo::with_date_time_format.
Members
newinvariant_infocurrent_infocalendarshort_date_patternset_short_date_patternlong_date_patternset_long_date_patternshort_time_patternset_short_time_patternlong_time_patternset_long_time_patternfull_date_time_patternset_full_date_time_patternmonth_day_patternset_month_day_patternyear_month_patternset_year_month_patternrfc1123_patternsortable_date_time_patternuniversal_sortable_date_time_patternam_designatorset_am_designatorpm_designatorset_pm_designatordate_separatorset_date_separatortime_separatorset_time_separatorfirst_day_of_weekset_first_day_of_weekcalendar_week_ruleset_calendar_week_ruleday_namesset_day_namesabbreviated_day_namesset_abbreviated_day_namesshortest_day_namesset_shortest_day_namesmonth_namesset_month_namesabbreviated_month_namesset_abbreviated_month_namesget_day_nameget_abbreviated_day_nameget_shortest_day_nameget_month_namemonth_genitive_namesset_month_genitive_namesabbreviated_month_genitive_namesset_abbreviated_month_genitive_namesget_abbreviated_month_nameget_era_nameset_era_name
new
fn new() -> DateTimeFormatInfo
Conventions with the values of the invariant culture (C#
new DateTimeFormatInfo()); change them with the setters.
invariant_info
fn invariant_info() -> Rc<DateTimeFormatInfo>
The conventions of the invariant culture.
current_info
fn current_info() -> Rc<DateTimeFormatInfo>
The conventions of the current culture.
calendar
fn calendar(self: &Self) -> GregorianCalendar
The calendar of the conventions; always the Gregorian one.
short_date_pattern
fn short_date_pattern(self: &Self) -> &str
The pattern of a short date (format "d").
set_short_date_pattern
fn set_short_date_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a short date.
long_date_pattern
fn long_date_pattern(self: &Self) -> &str
The pattern of a long date (format "D").
set_long_date_pattern
fn set_long_date_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a long date.
short_time_pattern
fn short_time_pattern(self: &Self) -> &str
The pattern of a short time (format "t").
set_short_time_pattern
fn set_short_time_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a short time.
long_time_pattern
fn long_time_pattern(self: &Self) -> &str
The pattern of a long time (format "T").
set_long_time_pattern
fn set_long_time_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a long time.
full_date_time_pattern
fn full_date_time_pattern(self: &Self) -> Cow<'_, str>
The pattern of a long date and long time (format "F"): the long
date pattern, a space and the long time pattern unless set explicitly.
set_full_date_time_pattern
fn set_full_date_time_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a long date and long time.
month_day_pattern
fn month_day_pattern(self: &Self) -> &str
The pattern of a month and day (format "M").
set_month_day_pattern
fn set_month_day_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a month and day.
year_month_pattern
fn year_month_pattern(self: &Self) -> &str
The pattern of a year and month (format "Y").
set_year_month_pattern
fn set_year_month_pattern(self: &mut Self, value: impl Into<String>)
Sets the pattern of a year and month.
rfc1123_pattern
fn rfc1123_pattern(self: &Self) -> &'static str
The pattern of the round-trip format "R" (RFC 1123).
sortable_date_time_pattern
fn sortable_date_time_pattern(self: &Self) -> &'static str
The pattern of the sortable format "s".
universal_sortable_date_time_pattern
fn universal_sortable_date_time_pattern(self: &Self) -> &'static str
The pattern of the universal sortable format "u".
am_designator
fn am_designator(self: &Self) -> &str
The designator of hours before noon.
set_am_designator
fn set_am_designator(self: &mut Self, value: impl Into<String>)
Sets the designator of hours before noon.
pm_designator
fn pm_designator(self: &Self) -> &str
The designator of hours after noon.
set_pm_designator
fn set_pm_designator(self: &mut Self, value: impl Into<String>)
Sets the designator of hours after noon.
date_separator
fn date_separator(self: &Self) -> &str
The text the / specifier of a custom format produces.
set_date_separator
fn set_date_separator(self: &mut Self, value: impl Into<String>)
Sets the date separator.
time_separator
fn time_separator(self: &Self) -> &str
The text the : specifier of a custom format produces.
set_time_separator
fn set_time_separator(self: &mut Self, value: impl Into<String>)
Sets the time separator.
first_day_of_week
fn first_day_of_week(self: &Self) -> DayOfWeek
The first day of the week.
set_first_day_of_week
fn set_first_day_of_week(self: &mut Self, value: DayOfWeek)
Sets the first day of the week.
calendar_week_rule
fn calendar_week_rule(self: &Self) -> CalendarWeekRule
The rule that determines the first week of a year.
set_calendar_week_rule
fn set_calendar_week_rule(self: &mut Self, value: CalendarWeekRule)
Sets the rule that determines the first week of a year.
day_names
fn day_names(self: &Self) -> &[String; 7]
The full names of the days, indexed by DayOfWeek (Sunday first).
set_day_names
fn set_day_names(self: &mut Self, value: [String; 7])
Sets the full names of the days.
abbreviated_day_names
fn abbreviated_day_names(self: &Self) -> &[String; 7]
The abbreviated names of the days, indexed by DayOfWeek.
set_abbreviated_day_names
fn set_abbreviated_day_names(self: &mut Self, value: [String; 7])
Sets the abbreviated names of the days.
shortest_day_names
fn shortest_day_names(self: &Self) -> &[String; 7]
The shortest unique names of the days, indexed by DayOfWeek.
set_shortest_day_names
fn set_shortest_day_names(self: &mut Self, value: [String; 7])
Sets the shortest names of the days.
month_names
fn month_names(self: &Self) -> &[String; 13]
The full names of the months; the thirteenth entry is empty, as in .NET.
set_month_names
fn set_month_names(self: &mut Self, value: [String; 13])
Sets the full names of the months.
abbreviated_month_names
fn abbreviated_month_names(self: &Self) -> &[String; 13]
The abbreviated names of the months; the thirteenth entry is empty.
set_abbreviated_month_names
fn set_abbreviated_month_names(self: &mut Self, value: [String; 13])
Sets the abbreviated names of the months.
get_day_name
fn get_day_name(self: &Self, day_of_week: DayOfWeek) -> &str
The full name of a day.
get_abbreviated_day_name
fn get_abbreviated_day_name(self: &Self, day_of_week: DayOfWeek) -> &str
The abbreviated name of a day.
get_shortest_day_name
fn get_shortest_day_name(self: &Self, day_of_week: DayOfWeek) -> &str
The shortest name of a day.
get_month_name
fn get_month_name(self: &Self, month: i32) -> &str
The full name of a month, 1..=13. Panics for other values.
month_genitive_names
fn month_genitive_names(self: &Self) -> &[String; 13]
The full names of the months in the form a date with a day number
takes (.NET MonthGenitiveNames): "7 stycznia" beside "styczeń 2026".
The plain names for a culture that has no such form.
set_month_genitive_names
fn set_month_genitive_names(self: &mut Self, value: [String; 13])
Sets the full names of the months in the form a date with a day number takes.
abbreviated_month_genitive_names
fn abbreviated_month_genitive_names(self: &Self) -> &[String; 13]
The abbreviated names of the months in the form a date with a day
number takes (.NET AbbreviatedMonthGenitiveNames). The plain
abbreviated names for a culture that has no such form.
set_abbreviated_month_genitive_names
fn set_abbreviated_month_genitive_names(self: &mut Self, value: [String; 13])
Sets the abbreviated names of the months in the form a date with a day number takes.
get_abbreviated_month_name
fn get_abbreviated_month_name(self: &Self, month: i32) -> &str
The abbreviated name of a month, 1..=13. Panics for other values.
get_era_name
fn get_era_name(self: &Self, _era: i32) -> &str
The name of the only era of the Gregorian calendar (the g specifier).
set_era_name
fn set_era_name(self: &mut Self, value: impl Into<String>)
Sets the name of the era.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEqEqDefaultDateTimeFormatProvider
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.