pub struct DateTimeFormatInfo { /* private fields */ }Expand description
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.
Implementations§
Source§impl DateTimeFormatInfo
impl DateTimeFormatInfo
Sourcepub fn new() -> DateTimeFormatInfo
pub fn new() -> DateTimeFormatInfo
Conventions with the values of the invariant culture (C#
new DateTimeFormatInfo()); change them with the setters.
Sourcepub fn invariant_info() -> Rc<DateTimeFormatInfo>
pub fn invariant_info() -> Rc<DateTimeFormatInfo>
The conventions of the invariant culture.
Sourcepub fn current_info() -> Rc<DateTimeFormatInfo>
pub fn current_info() -> Rc<DateTimeFormatInfo>
The conventions of the current culture.
Sourcepub fn calendar(&self) -> GregorianCalendar
pub fn calendar(&self) -> GregorianCalendar
The calendar of the conventions; always the Gregorian one.
Sourcepub fn short_date_pattern(&self) -> &str
pub fn short_date_pattern(&self) -> &str
The pattern of a short date (format "d").
Sourcepub fn set_short_date_pattern(&mut self, value: impl Into<String>)
pub fn set_short_date_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a short date.
Sourcepub fn long_date_pattern(&self) -> &str
pub fn long_date_pattern(&self) -> &str
The pattern of a long date (format "D").
Sourcepub fn set_long_date_pattern(&mut self, value: impl Into<String>)
pub fn set_long_date_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a long date.
Sourcepub fn short_time_pattern(&self) -> &str
pub fn short_time_pattern(&self) -> &str
The pattern of a short time (format "t").
Sourcepub fn set_short_time_pattern(&mut self, value: impl Into<String>)
pub fn set_short_time_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a short time.
Sourcepub fn long_time_pattern(&self) -> &str
pub fn long_time_pattern(&self) -> &str
The pattern of a long time (format "T").
Sourcepub fn set_long_time_pattern(&mut self, value: impl Into<String>)
pub fn set_long_time_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a long time.
Sourcepub fn full_date_time_pattern(&self) -> Cow<'_, str>
pub fn full_date_time_pattern(&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.
Sourcepub fn set_full_date_time_pattern(&mut self, value: impl Into<String>)
pub fn set_full_date_time_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a long date and long time.
Sourcepub fn month_day_pattern(&self) -> &str
pub fn month_day_pattern(&self) -> &str
The pattern of a month and day (format "M").
Sourcepub fn set_month_day_pattern(&mut self, value: impl Into<String>)
pub fn set_month_day_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a month and day.
Sourcepub fn year_month_pattern(&self) -> &str
pub fn year_month_pattern(&self) -> &str
The pattern of a year and month (format "Y").
Sourcepub fn set_year_month_pattern(&mut self, value: impl Into<String>)
pub fn set_year_month_pattern(&mut self, value: impl Into<String>)
Sets the pattern of a year and month.
Sourcepub fn rfc1123_pattern(&self) -> &'static str
pub fn rfc1123_pattern(&self) -> &'static str
The pattern of the round-trip format "R" (RFC 1123).
Sourcepub fn sortable_date_time_pattern(&self) -> &'static str
pub fn sortable_date_time_pattern(&self) -> &'static str
The pattern of the sortable format "s".
Sourcepub fn universal_sortable_date_time_pattern(&self) -> &'static str
pub fn universal_sortable_date_time_pattern(&self) -> &'static str
The pattern of the universal sortable format "u".
Sourcepub fn am_designator(&self) -> &str
pub fn am_designator(&self) -> &str
The designator of hours before noon.
Sourcepub fn set_am_designator(&mut self, value: impl Into<String>)
pub fn set_am_designator(&mut self, value: impl Into<String>)
Sets the designator of hours before noon.
Sourcepub fn pm_designator(&self) -> &str
pub fn pm_designator(&self) -> &str
The designator of hours after noon.
Sourcepub fn set_pm_designator(&mut self, value: impl Into<String>)
pub fn set_pm_designator(&mut self, value: impl Into<String>)
Sets the designator of hours after noon.
Sourcepub fn date_separator(&self) -> &str
pub fn date_separator(&self) -> &str
The text the / specifier of a custom format produces.
Sourcepub fn set_date_separator(&mut self, value: impl Into<String>)
pub fn set_date_separator(&mut self, value: impl Into<String>)
Sets the date separator.
Sourcepub fn time_separator(&self) -> &str
pub fn time_separator(&self) -> &str
The text the : specifier of a custom format produces.
Sourcepub fn set_time_separator(&mut self, value: impl Into<String>)
pub fn set_time_separator(&mut self, value: impl Into<String>)
Sets the time separator.
Sourcepub fn first_day_of_week(&self) -> DayOfWeek
pub fn first_day_of_week(&self) -> DayOfWeek
The first day of the week.
Sourcepub fn set_first_day_of_week(&mut self, value: DayOfWeek)
pub fn set_first_day_of_week(&mut self, value: DayOfWeek)
Sets the first day of the week.
Sourcepub fn calendar_week_rule(&self) -> CalendarWeekRule
pub fn calendar_week_rule(&self) -> CalendarWeekRule
The rule that determines the first week of a year.
Sourcepub fn set_calendar_week_rule(&mut self, value: CalendarWeekRule)
pub fn set_calendar_week_rule(&mut self, value: CalendarWeekRule)
Sets the rule that determines the first week of a year.
Sourcepub fn day_names(&self) -> &[String; 7]
pub fn day_names(&self) -> &[String; 7]
The full names of the days, indexed by DayOfWeek (Sunday first).
Sourcepub fn set_day_names(&mut self, value: [String; 7])
pub fn set_day_names(&mut self, value: [String; 7])
Sets the full names of the days.
Sourcepub fn abbreviated_day_names(&self) -> &[String; 7]
pub fn abbreviated_day_names(&self) -> &[String; 7]
The abbreviated names of the days, indexed by DayOfWeek.
Sourcepub fn set_abbreviated_day_names(&mut self, value: [String; 7])
pub fn set_abbreviated_day_names(&mut self, value: [String; 7])
Sets the abbreviated names of the days.
Sourcepub fn shortest_day_names(&self) -> &[String; 7]
pub fn shortest_day_names(&self) -> &[String; 7]
The shortest unique names of the days, indexed by DayOfWeek.
Sourcepub fn set_shortest_day_names(&mut self, value: [String; 7])
pub fn set_shortest_day_names(&mut self, value: [String; 7])
Sets the shortest names of the days.
Sourcepub fn month_names(&self) -> &[String; 13]
pub fn month_names(&self) -> &[String; 13]
The full names of the months; the thirteenth entry is empty, as in .NET.
Sourcepub fn set_month_names(&mut self, value: [String; 13])
pub fn set_month_names(&mut self, value: [String; 13])
Sets the full names of the months.
Sourcepub fn abbreviated_month_names(&self) -> &[String; 13]
pub fn abbreviated_month_names(&self) -> &[String; 13]
The abbreviated names of the months; the thirteenth entry is empty.
Sourcepub fn set_abbreviated_month_names(&mut self, value: [String; 13])
pub fn set_abbreviated_month_names(&mut self, value: [String; 13])
Sets the abbreviated names of the months.
Sourcepub fn get_day_name(&self, day_of_week: DayOfWeek) -> &str
pub fn get_day_name(&self, day_of_week: DayOfWeek) -> &str
The full name of a day.
Sourcepub fn get_abbreviated_day_name(&self, day_of_week: DayOfWeek) -> &str
pub fn get_abbreviated_day_name(&self, day_of_week: DayOfWeek) -> &str
The abbreviated name of a day.
Sourcepub fn get_shortest_day_name(&self, day_of_week: DayOfWeek) -> &str
pub fn get_shortest_day_name(&self, day_of_week: DayOfWeek) -> &str
The shortest name of a day.
Sourcepub fn get_month_name(&self, month: i32) -> &str
pub fn get_month_name(&self, month: i32) -> &str
The full name of a month, 1..=13. Panics for other values.
Sourcepub fn get_abbreviated_month_name(&self, month: i32) -> &str
pub fn get_abbreviated_month_name(&self, month: i32) -> &str
The abbreviated name of a month, 1..=13. Panics for other values.
Sourcepub fn get_era_name(&self, _era: i32) -> &str
pub fn get_era_name(&self, _era: i32) -> &str
The name of the only era of the Gregorian calendar (the g specifier).
Sourcepub fn set_era_name(&mut self, value: impl Into<String>)
pub fn set_era_name(&mut self, value: impl Into<String>)
Sets the name of the era.
Trait Implementations§
Source§impl Clone for DateTimeFormatInfo
impl Clone for DateTimeFormatInfo
Source§impl DateTimeFormatProvider for DateTimeFormatInfo
impl DateTimeFormatProvider for DateTimeFormatInfo
Source§fn get_date_time_format(&self) -> DateTimeFormatInfoRef<'_>
fn get_date_time_format(&self) -> DateTimeFormatInfoRef<'_>
Source§impl Debug for DateTimeFormatInfo
impl Debug for DateTimeFormatInfo
Source§impl Default for DateTimeFormatInfo
impl Default for DateTimeFormatInfo
impl Eq for DateTimeFormatInfo
Source§impl PartialEq for DateTimeFormatInfo
impl PartialEq for DateTimeFormatInfo
impl StructuralPartialEq for DateTimeFormatInfo
Auto Trait Implementations§
impl Freeze for DateTimeFormatInfo
impl RefUnwindSafe for DateTimeFormatInfo
impl Send for DateTimeFormatInfo
impl Sync for DateTimeFormatInfo
impl Unpin for DateTimeFormatInfo
impl UnsafeUnpin for DateTimeFormatInfo
impl UnwindSafe for DateTimeFormatInfo
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more