System::Globalization::DateTimeFormatInfo 类

DateTimeFormatInfo class

日期和时间格式化参数的集合。此类的对象只能使用 System::MakeObject() 函数分配。切勿在栈上或使用 operator new 创建此类型的实例,因为这会导致运行时错误和/或断言故障。始终将此类包装到 System::SmartPtr 指针中,并使用该指针将其作为参数传递给函数。

class DateTimeFormatInfo : public virtual System::Object,
                           public System::IFormatProvider,
                           public System::ICloneable

方法

方法描述
Clone() override克隆格式信息。
DateTimeFormatInfo()默认构造函数,构造不变的格式信息。
get_AbbreviatedDayNames() const获取缩写的星期名称。
get_AbbreviatedMonthGenitiveNames() const获取属格形式的缩写月份名称。
get_AbbreviatedMonthNames() const获取缩写的月份名称。
get_AMDesignator() const获取上午标识符。
get_Calendar() const获取与格式化程序关联的日历。
get_CalendarWeekRule() const获取与格式化程序关联的日历周规则。
static get_CurrentInfo()获取当前线程的日期和时间格式化程序。
get_DateSeparator() const获取日期分隔符。
get_DayNames() const获取星期名称。
get_FirstDayOfWeek() const获取一周的第一天。
get_FullDateTimePattern() const获取完整的日期和时间模式。
static get_InvariantInfo()获取不变的日期和时间格式化程序。
get_IsReadOnly() const检查格式化程序是否为只读。
get_LongDatePattern() const获取长日期模式。
get_LongTimePattern() const获取长时间模式。
get_MonthDayPattern() const获取月份日模式。
get_MonthGenitiveNames() const获取月份的所有格形式名称。
get_MonthNames() const获取月份名称。
get_NativeCalendarName() const如果可用,获取本地日历名称。
get_PMDesignator() const获取下午标识符。
get_RFC1123Pattern() const获取 RFC1123 模式。
get_ShortDatePattern() const获取短日期模式。
get_ShortestDayNames() const获取最短的星期名称。
get_ShortTimePattern() const获取短时间模式。
get_SortableDateTimePattern() const获取可排序的日期和时间模式。
get_TimeSeparator() const获取时间分隔符。
get_UniversalSortableDateTimePattern() const获取通用可排序的日期和时间模式。
get_YearMonthPattern() const获取年份和月份模式。
GetAbbreviatedDayName(DayOfWeek) const获取星期的缩写名称。
GetAbbreviatedEraName(int) const获取纪元的缩写名称。
GetAbbreviatedMonthName(int) const获取月份的缩写名称。
GetAllDateTimePatterns() const获取日期和时间值可以格式化的所有模式。
GetAllDateTimePatterns(char16_t) const使用指定的格式字符串获取日期和时间值可以格式化的所有模式。
GetDayName(DayOfWeek) const获取星期名称。
GetEra(const String&) const按名称获取纪元。
GetEraName(int) const获取纪元名称。
GetFormat(const TypeInfo&) override获取特定类型的格式化程序。
static GetInstance(const IFormatProviderPtr&)获取与格式提供程序关联的格式化程序。
GetLeapYearMonthName(int) const获取闰月名称。
GetMonthGenitiveName(int) const获取月份的所有格形式名称。
GetMonthName(int) const获取月份名称。
GetShortestDayName(DayOfWeek) const获取指定星期几的最短名称。
operator=(const DateTimeFormatInfo&)
static ReadOnly(const DateTimeFormatInfoPtr&)获取格式化程序的只读版本。
set_AbbreviatedDayNames(const ArrayPtr<String>&)设置缩写的星期名称。
set_AbbreviatedMonthGenitiveNames(const ArrayPtr<String>&)设置属格形式的缩写月份名称。
set_AbbreviatedMonthNames(const ArrayPtr<String>&)设置缩写的月份名称。
set_AMDesignator(const String&)设置上午标识。
set_Calendar(const SharedPtr<Calendar>&)设置与格式化程序关联的日历。
set_CalendarWeekRule(CalendarWeekRule)设置与格式化程序关联的日历周规则。
set_DateSeparator(const String&)设置日期分隔符。
set_DayNames(const ArrayPtr<String>&)设置星期名称。
set_FirstDayOfWeek(DayOfWeek)设置一周的第一天。
set_FullDateTimePattern(const String&)设置完整的日期和时间模式。
set_LongDatePattern(const String&)设置长日期模式。
set_LongTimePattern(const String&)设置长时间模式。
set_MonthDayPattern(const String&)设置月份日期模式。
set_MonthGenitiveNames(const ArrayPtr<String>&)设置属格形式的月份名称。
set_MonthNames(const ArrayPtr<String>&)设置月份名称。
set_PMDesignator(const String&)设置下午标识。
set_ShortDatePattern(const String&)设置短日期模式。
set_ShortestDayNames(const ArrayPtr<String>&)设置可能的最短星期名称。
set_ShortTimePattern(const String&)设置短时间模式。
set_TimeSeparator(const String&)设置时间分隔符。
set_YearMonthPattern(const String&)设置年月模式。
SetAllDateTimePatterns(const ArrayPtr<String>&, char16_t)为指定格式设置模式。

另见