Calendar Calendar Calendar Calendar Calendar Class

Definition

Manipulates the representation of a date and time within a given calendar and clock.

public : sealed class Calendar : ICalendar, ITimeZoneOnCalendar
struct winrt::Windows::Globalization::Calendar : ICalendar, ITimeZoneOnCalendar
public sealed class Calendar : ICalendar, ITimeZoneOnCalendar
Public NotInheritable Class Calendar Implements ICalendar, ITimeZoneOnCalendar
var calendar = new calendar();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.

Starting in : Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.

Constructors

Calendar() Calendar() Calendar() Calendar() Calendar()

Creates a Calendar object and initializes it to the current date and time.

public : Calendar()
Calendar() const;
public Calendar()
Public Sub New()
var calendar = new calendar();
See Also

Calendar(IIterable) Calendar(IIterable) Calendar(IIterable) Calendar(IIterable) Calendar(IIterable)

Creates a Calendar object that is initialized with a language list.

public : Calendar(IIterable<Platform::String> languages)
Calendar(IIterable<winrt::hstring> languages) const;
public Calendar(IEnumerable<String> languages)
Public Sub New(languages As IEnumerable<String>)
var calendar = new calendar(languages);
Parameters
languages
IEnumerable<String> IEnumerable<String> IEnumerable<String>

The list of language identifiers, in priority order, that represents the choice of languages. These are used for resolving patterns to strings. See Remarks.

See Also

Calendar(IIterable, String, String) Calendar(IIterable, String, String) Calendar(IIterable, String, String) Calendar(IIterable, String, String) Calendar(IIterable, String, String)

Creates a Calendar object that is initialized with a language list, calendar, and clock.

public : Calendar(IIterable<Platform::String> languages, Platform::String calendar, Platform::String clock)
Calendar(IIterable<winrt::hstring> languages, winrt::hstring calendar, winrt::hstring clock) const;
public Calendar(IEnumerable<String> languages, String calendar, String clock)
Public Sub New(languages As IEnumerable<String>, calendar As String, clock As String)
var calendar = new calendar(languages, calendar, clock);
Parameters
languages
IEnumerable<String> IEnumerable<String> IEnumerable<String>

The list of language identifiers, in priority order, representing the choice of languages. These are used for resolving patterns to strings. See Remarks.

calendar
String String String

The calendar identifier to use.

clock
String String String

The clock identifier to use.

See Also

Calendar(IIterable, String, String, String) Calendar(IIterable, String, String, String) Calendar(IIterable, String, String, String) Calendar(IIterable, String, String, String) Calendar(IIterable, String, String, String)

Creates a Calendar object that is initialized with a language list, calendar, clock, and time zone.

public : Calendar(IIterable<Platform::String> languages, Platform::String calendar, Platform::String clock, Platform::String timeZoneId)
Calendar(IIterable<winrt::hstring> languages, winrt::hstring calendar, winrt::hstring clock, winrt::hstring timeZoneId) const;
public Calendar(IEnumerable<String> languages, String calendar, String clock, String timeZoneId)
Public Sub New(languages As IEnumerable<String>, calendar As String, clock As String, timeZoneId As String)
var calendar = new calendar(languages, calendar, clock, timeZoneId);
Parameters
languages
IEnumerable<String> IEnumerable<String> IEnumerable<String>

The list of language identifiers, in priority order, representing the choice of languages. These are used for resolving patterns to strings. See Remarks.

calendar
String String String

The calendar identifier to use.

clock
String String String

The clock identifier to use.

timeZoneId
String String String

An identifier from the IANA Time Zone Database which identifies the time zone that should be used (for example, "America/Los_Angeles" for Pacific Time).

See Also

Properties

Day Day Day Day Day

Gets or sets the day.

public : int Day { get; set; }
int32_t Day(); void Day(int32_t day);
public int Day { get; set; }
Public ReadWrite Property Day As int
var int = calendar.day;
calendar.day = int;
Value
int int int

The day.

DayOfWeek DayOfWeek DayOfWeek DayOfWeek DayOfWeek

Gets the day of the week.

public : DayOfWeek DayOfWeek { get; }
DayOfWeek DayOfWeek();
public DayOfWeek DayOfWeek { get; }
Public ReadOnly Property DayOfWeek As DayOfWeek
var dayOfWeek = calendar.dayOfWeek;
Value
DayOfWeek DayOfWeek DayOfWeek

The day of the week.

Era Era Era Era Era

Gets or sets the era.

public : int Era { get; set; }
int32_t Era(); void Era(int32_t era);
public int Era { get; set; }
Public ReadWrite Property Era As int
var int = calendar.era;
calendar.era = int;
Value
int int int

The integer that represents the era.

FirstDayInThisMonth FirstDayInThisMonth FirstDayInThisMonth FirstDayInThisMonth FirstDayInThisMonth

Gets the first Day of the current Month.

public : int FirstDayInThisMonth { get; }
int32_t FirstDayInThisMonth();
public int FirstDayInThisMonth { get; }
Public ReadOnly Property FirstDayInThisMonth As int
var int = calendar.firstDayInThisMonth;
Value
int int int

The first Day of the current Month.

FirstEra FirstEra FirstEra FirstEra FirstEra

Gets the first Era available in the calendar.

public : int FirstEra { get; }
int32_t FirstEra();
public int FirstEra { get; }
Public ReadOnly Property FirstEra As int
var int = calendar.firstEra;
Value
int int int

The first Era in the calendar.

FirstHourInThisPeriod FirstHourInThisPeriod FirstHourInThisPeriod FirstHourInThisPeriod FirstHourInThisPeriod

Gets the first Hour of the current Period.

public : int FirstHourInThisPeriod { get; }
int32_t FirstHourInThisPeriod();
public int FirstHourInThisPeriod { get; }
Public ReadOnly Property FirstHourInThisPeriod As int
var int = calendar.firstHourInThisPeriod;
Value
int int int

The first Hour of the current Period.

FirstMinuteInThisHour FirstMinuteInThisHour FirstMinuteInThisHour FirstMinuteInThisHour FirstMinuteInThisHour

Gets the first Minute of the current Hour.

public : int FirstMinuteInThisHour { get; }
int32_t FirstMinuteInThisHour();
public int FirstMinuteInThisHour { get; }
Public ReadOnly Property FirstMinuteInThisHour As int
var int = calendar.firstMinuteInThisHour;
Value
int int int

The first Minute of the current Hour.

FirstMonthInThisYear FirstMonthInThisYear FirstMonthInThisYear FirstMonthInThisYear FirstMonthInThisYear

Gets the first Month of the current Year.

public : int FirstMonthInThisYear { get; }
int32_t FirstMonthInThisYear();
public int FirstMonthInThisYear { get; }
Public ReadOnly Property FirstMonthInThisYear As int
var int = calendar.firstMonthInThisYear;
Value
int int int

The first Month of the current Year.

FirstPeriodInThisDay FirstPeriodInThisDay FirstPeriodInThisDay FirstPeriodInThisDay FirstPeriodInThisDay

Gets the first Period of the current Day.

public : int FirstPeriodInThisDay { get; }
int32_t FirstPeriodInThisDay();
public int FirstPeriodInThisDay { get; }
Public ReadOnly Property FirstPeriodInThisDay As int
var int = calendar.firstPeriodInThisDay;
Value
int int int

The first Period of the current Day.

FirstSecondInThisMinute FirstSecondInThisMinute FirstSecondInThisMinute FirstSecondInThisMinute FirstSecondInThisMinute

Gets the first Second of the current Minute.

public : int FirstSecondInThisMinute { get; }
int32_t FirstSecondInThisMinute();
public int FirstSecondInThisMinute { get; }
Public ReadOnly Property FirstSecondInThisMinute As int
var int = calendar.firstSecondInThisMinute;
Value
int int int

The first Second of the current Minute.

FirstYearInThisEra FirstYearInThisEra FirstYearInThisEra FirstYearInThisEra FirstYearInThisEra

Gets the first Year of the current Era.

public : int FirstYearInThisEra { get; }
int32_t FirstYearInThisEra();
public int FirstYearInThisEra { get; }
Public ReadOnly Property FirstYearInThisEra As int
var int = calendar.firstYearInThisEra;
Value
int int int

The first Year of the current Era.

Hour Hour Hour Hour Hour

Gets or sets the hour.

public : int Hour { get; set; }
int32_t Hour(); void Hour(int32_t hour);
public int Hour { get; set; }
Public ReadWrite Property Hour As int
var int = calendar.hour;
calendar.hour = int;
Value
int int int

The hour.

IsDaylightSavingTime IsDaylightSavingTime IsDaylightSavingTime IsDaylightSavingTime IsDaylightSavingTime

Gets a Boolean indicating if Daylight Saving Time is in effect for the date of this Calendar object.

public : Platform::Boolean IsDaylightSavingTime { get; }
bool IsDaylightSavingTime();
public bool IsDaylightSavingTime { get; }
Public ReadOnly Property IsDaylightSavingTime As bool
var bool = calendar.isDaylightSavingTime;
Value
bool bool bool

True if Daylight Saving Time is in effect for the date; otherwise, False.

Languages Languages Languages Languages Languages

Gets the priority list of language identifiers that is used when formatting components as strings.

public : IVectorView<Platform::String> Languages { get; }
IVectorView<winrt::hstring> Languages();
public IReadOnlyList<string> Languages { get; }
Public ReadOnly Property Languages As IReadOnlyList<string>
var iReadOnlyList = calendar.languages;
Value
IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

The list of language identifiers.

Starting in : Language tags can support Unicode extensions. See the Remarks for the Calendar(IIterable(String)) constructor.

LastDayInThisMonth LastDayInThisMonth LastDayInThisMonth LastDayInThisMonth LastDayInThisMonth

Gets the last Day of the current Month.

public : int LastDayInThisMonth { get; }
int32_t LastDayInThisMonth();
public int LastDayInThisMonth { get; }
Public ReadOnly Property LastDayInThisMonth As int
var int = calendar.lastDayInThisMonth;
Value
int int int

The last Day of the current Month.

LastEra LastEra LastEra LastEra LastEra

Gets the last Era available in the calendar.

public : int LastEra { get; }
int32_t LastEra();
public int LastEra { get; }
Public ReadOnly Property LastEra As int
var int = calendar.lastEra;
Value
int int int

The last Era in the calendar.

LastHourInThisPeriod LastHourInThisPeriod LastHourInThisPeriod LastHourInThisPeriod LastHourInThisPeriod

Gets the last Hour of the current Period.

public : int LastHourInThisPeriod { get; }
int32_t LastHourInThisPeriod();
public int LastHourInThisPeriod { get; }
Public ReadOnly Property LastHourInThisPeriod As int
var int = calendar.lastHourInThisPeriod;
Value
int int int

The last Hour of the current Period.

LastMinuteInThisHour LastMinuteInThisHour LastMinuteInThisHour LastMinuteInThisHour LastMinuteInThisHour

Gets the last Minute of the current Hour.

public : int LastMinuteInThisHour { get; }
int32_t LastMinuteInThisHour();
public int LastMinuteInThisHour { get; }
Public ReadOnly Property LastMinuteInThisHour As int
var int = calendar.lastMinuteInThisHour;
Value
int int int

The last Minute of the current Hour.

LastMonthInThisYear LastMonthInThisYear LastMonthInThisYear LastMonthInThisYear LastMonthInThisYear

Gets the last Month of the current Year.

public : int LastMonthInThisYear { get; }
int32_t LastMonthInThisYear();
public int LastMonthInThisYear { get; }
Public ReadOnly Property LastMonthInThisYear As int
var int = calendar.lastMonthInThisYear;
Value
int int int

The last Month of the current Year.

LastPeriodInThisDay LastPeriodInThisDay LastPeriodInThisDay LastPeriodInThisDay LastPeriodInThisDay

Gets the last Period of the current Day.

public : int LastPeriodInThisDay { get; }
int32_t LastPeriodInThisDay();
public int LastPeriodInThisDay { get; }
Public ReadOnly Property LastPeriodInThisDay As int
var int = calendar.lastPeriodInThisDay;
Value
int int int

The last Period of the current Day.

LastSecondInThisMinute LastSecondInThisMinute LastSecondInThisMinute LastSecondInThisMinute LastSecondInThisMinute

Gets the last Second of the current Minute.

public : int LastSecondInThisMinute { get; }
int32_t LastSecondInThisMinute();
public int LastSecondInThisMinute { get; }
Public ReadOnly Property LastSecondInThisMinute As int
var int = calendar.lastSecondInThisMinute;
Value
int int int

The last Second of the current Minute.

LastYearInThisEra LastYearInThisEra LastYearInThisEra LastYearInThisEra LastYearInThisEra

Gets the last Year of the current Era.

public : int LastYearInThisEra { get; }
int32_t LastYearInThisEra();
public int LastYearInThisEra { get; }
Public ReadOnly Property LastYearInThisEra As int
var int = calendar.lastYearInThisEra;
Value
int int int

The last Year of the current Era.

Minute Minute Minute Minute Minute

Gets or sets the minute.

public : int Minute { get; set; }
int32_t Minute(); void Minute(int32_t minute);
public int Minute { get; set; }
Public ReadWrite Property Minute As int
var int = calendar.minute;
calendar.minute = int;
Value
int int int

The minute.

Month Month Month Month Month

Gets or sets the month.

public : int Month { get; set; }
int32_t Month(); void Month(int32_t month);
public int Month { get; set; }
Public ReadWrite Property Month As int
var int = calendar.month;
calendar.month = int;
Value
int int int

The month.

Nanosecond Nanosecond Nanosecond Nanosecond Nanosecond

Gets or sets the nanosecond.

public : int Nanosecond { get; set; }
int32_t Nanosecond(); void Nanosecond(int32_t nanosecond);
public int Nanosecond { get; set; }
Public ReadWrite Property Nanosecond As int
var int = calendar.nanosecond;
calendar.nanosecond = int;
Value
int int int

The nanosecond.

NumberOfDaysInThisMonth NumberOfDaysInThisMonth NumberOfDaysInThisMonth NumberOfDaysInThisMonth NumberOfDaysInThisMonth

Gets the number of days in the current month of this Calendar object.

public : int NumberOfDaysInThisMonth { get; }
int32_t NumberOfDaysInThisMonth();
public int NumberOfDaysInThisMonth { get; }
Public ReadOnly Property NumberOfDaysInThisMonth As int
var int = calendar.numberOfDaysInThisMonth;
Value
int int int

The number of days in the current month, or – 1 if the number of days in the current month is unknown.

NumberOfEras NumberOfEras NumberOfEras NumberOfEras NumberOfEras

Gets the number of eras in this Calendar object.

public : int NumberOfEras { get; }
int32_t NumberOfEras();
public int NumberOfEras { get; }
Public ReadOnly Property NumberOfEras As int
var int = calendar.numberOfEras;
Value
int int int

The number of eras in the Calendar, or – 1 if the number of eras in the Calendar is unknown.

NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod

Gets the number of hours in the current day period of this Calendar object.

public : int NumberOfHoursInThisPeriod { get; }
int32_t NumberOfHoursInThisPeriod();
public int NumberOfHoursInThisPeriod { get; }
Public ReadOnly Property NumberOfHoursInThisPeriod As int
var int = calendar.numberOfHoursInThisPeriod;
Value
int int int

The number of hours in the current day period, or – 1 if the number of hours in the current day period is unknown.

NumberOfMinutesInThisHour NumberOfMinutesInThisHour NumberOfMinutesInThisHour NumberOfMinutesInThisHour NumberOfMinutesInThisHour

Gets the number of Minute s in the current Hour.

public : int NumberOfMinutesInThisHour { get; }
int32_t NumberOfMinutesInThisHour();
public int NumberOfMinutesInThisHour { get; }
Public ReadOnly Property NumberOfMinutesInThisHour As int
var int = calendar.numberOfMinutesInThisHour;
Value
int int int

The number of Minute s in the current Hour.

NumberOfMonthsInThisYear NumberOfMonthsInThisYear NumberOfMonthsInThisYear NumberOfMonthsInThisYear NumberOfMonthsInThisYear

Gets the number of months in the current year of this Calendar object.

public : int NumberOfMonthsInThisYear { get; }
int32_t NumberOfMonthsInThisYear();
public int NumberOfMonthsInThisYear { get; }
Public ReadOnly Property NumberOfMonthsInThisYear As int
var int = calendar.numberOfMonthsInThisYear;
Value
int int int

The number of months in the current year, or – 1 if the number of months in the current year is unknown.

NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay

Gets the number of periods in the current day of this Calendar object.

public : int NumberOfPeriodsInThisDay { get; }
int32_t NumberOfPeriodsInThisDay();
public int NumberOfPeriodsInThisDay { get; }
Public ReadOnly Property NumberOfPeriodsInThisDay As int
var int = calendar.numberOfPeriodsInThisDay;
Value
int int int

The number of periods in the current day, or – 1 if the number of periods in the current day is unknown.

NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute

Gets the number of Second s in the current Minute.

public : int NumberOfSecondsInThisMinute { get; }
int32_t NumberOfSecondsInThisMinute();
public int NumberOfSecondsInThisMinute { get; }
Public ReadOnly Property NumberOfSecondsInThisMinute As int
var int = calendar.numberOfSecondsInThisMinute;
Value
int int int

The number of Second s in the current Minute.

NumberOfYearsInThisEra NumberOfYearsInThisEra NumberOfYearsInThisEra NumberOfYearsInThisEra NumberOfYearsInThisEra

Gets the number of years in the current era of this Calendar object.

public : int NumberOfYearsInThisEra { get; }
int32_t NumberOfYearsInThisEra();
public int NumberOfYearsInThisEra { get; }
Public ReadOnly Property NumberOfYearsInThisEra As int
var int = calendar.numberOfYearsInThisEra;
Value
int int int

The number of years in the current era, or – 1 if there is no known bound to the number of years in the current era.

NumeralSystem NumeralSystem NumeralSystem NumeralSystem NumeralSystem

Gets or sets the numbering system that is used when formatting components as strings.

public : Platform::String NumeralSystem { get; set; }
winrt::hstring NumeralSystem(); void NumeralSystem(winrt::hstring numeralsystem);
public string NumeralSystem { get; set; }
Public ReadWrite Property NumeralSystem As string
var string = calendar.numeralSystem;
calendar.numeralSystem = string;
Value
string string string

A string that indicates the numeral system of the calendar, such as "Latn" for the Latin numeral system (0123456789) or "Arab" for the Arabic-Indic numeral system (٠١٢٣٤٥٦٧٨٩). See the supported NumeralSystem values.

See Also

Period Period Period Period Period

Gets or sets the period of the current day.

public : int Period { get; set; }
int32_t Period(); void Period(int32_t period);
public int Period { get; set; }
Public ReadWrite Property Period As int
var int = calendar.period;
calendar.period = int;
Value
int int int

A numeric representation of the current day period. With a 12-hour clock, for example, the first period of the day is 1, representing AM, and the second period is 2, representing PM.

ResolvedLanguage ResolvedLanguage ResolvedLanguage ResolvedLanguage ResolvedLanguage

Gets the language that was most recently used to perform calendar formatting or operations.

public : Platform::String ResolvedLanguage { get; }
winrt::hstring ResolvedLanguage();
public string ResolvedLanguage { get; }
Public ReadOnly Property ResolvedLanguage As string
var string = calendar.resolvedLanguage;
Value
string string string

The language from the priority list of language identifiers that was most recently used to perform calendar formatting or operations.

Starting in : Language tags can support Unicode extensions. See the Remarks for the Calendar(IIterable(String)) constructor.

Second Second Second Second Second

Gets or sets the second.

public : int Second { get; set; }
int32_t Second(); void Second(int32_t second);
public int Second { get; set; }
Public ReadWrite Property Second As int
var int = calendar.second;
calendar.second = int;
Value
int int int

The second.

Year Year Year Year Year

Gets or sets the year.

public : int Year { get; set; }
int32_t Year(); void Year(int32_t year);
public int Year { get; set; }
Public ReadWrite Property Year As int
var int = calendar.year;
calendar.year = int;
Value
int int int

The year.

Methods

AddDays(Int32) AddDays(Int32) AddDays(Int32) AddDays(Int32) AddDays(Int32)

Increments or decrements the day.

public : void AddDays(int days)
void AddDays(int32_t days) const;
public void AddDays(Int32 days)
Public Function AddDays(days As Int32) As void
calendar.addDays(days);
Parameters
days
Int32 Int32 Int32

The number of days by which to increment the day (if the value is positive) or decrement the day (if the value is negative).

AddEras(Int32) AddEras(Int32) AddEras(Int32) AddEras(Int32) AddEras(Int32)

Increments or decrements the era.

public : void AddEras(int eras)
void AddEras(int32_t eras) const;
public void AddEras(Int32 eras)
Public Function AddEras(eras As Int32) As void
calendar.addEras(eras);
Parameters
eras
Int32 Int32 Int32

The number of eras by which to increment the era (if the value is positive) or decrement the era (if the value is negative).

AddHours(Int32) AddHours(Int32) AddHours(Int32) AddHours(Int32) AddHours(Int32)

Increments or decrements the hour.

public : void AddHours(int hours)
void AddHours(int32_t hours) const;
public void AddHours(Int32 hours)
Public Function AddHours(hours As Int32) As void
calendar.addHours(hours);
Parameters
hours
Int32 Int32 Int32

The number of hours by which to increment the hour (if the value is positive) or decrement the hour (if the value is negative).

AddMinutes(Int32) AddMinutes(Int32) AddMinutes(Int32) AddMinutes(Int32) AddMinutes(Int32)

Increments or decrements the minute.

public : void AddMinutes(int minutes)
void AddMinutes(int32_t minutes) const;
public void AddMinutes(Int32 minutes)
Public Function AddMinutes(minutes As Int32) As void
calendar.addMinutes(minutes);
Parameters
minutes
Int32 Int32 Int32

The number of minutes by which to increment the minute (if the value is positive) or decrement the minute (if the value is negative).

AddMonths(Int32) AddMonths(Int32) AddMonths(Int32) AddMonths(Int32) AddMonths(Int32)

Increments or decrements the month.

public : void AddMonths(int months)
void AddMonths(int32_t months) const;
public void AddMonths(Int32 months)
Public Function AddMonths(months As Int32) As void
calendar.addMonths(months);
Parameters
months
Int32 Int32 Int32

The number of months by which to increment the month (if the value is positive) or decrement the month (if the value is negative).

AddNanoseconds(Int32) AddNanoseconds(Int32) AddNanoseconds(Int32) AddNanoseconds(Int32) AddNanoseconds(Int32)

Increments or decrements the nanosecond.

public : void AddNanoseconds(int nanoseconds)
void AddNanoseconds(int32_t nanoseconds) const;
public void AddNanoseconds(Int32 nanoseconds)
Public Function AddNanoseconds(nanoseconds As Int32) As void
calendar.addNanoseconds(nanoseconds);
Parameters
nanoseconds
Int32 Int32 Int32

The number of nanoseconds by which to increment the nanosecond (if the value is positive) or decrement the nanosecond (if the value is negative).

AddPeriods(Int32) AddPeriods(Int32) AddPeriods(Int32) AddPeriods(Int32) AddPeriods(Int32)

Increments or decrements the period.

public : void AddPeriods(int periods)
void AddPeriods(int32_t periods) const;
public void AddPeriods(Int32 periods)
Public Function AddPeriods(periods As Int32) As void
calendar.addPeriods(periods);
Parameters
periods
Int32 Int32 Int32

The number of periods by which to increment the period (if the value is positive) or decrement the period (if the value is negative).

AddSeconds(Int32) AddSeconds(Int32) AddSeconds(Int32) AddSeconds(Int32) AddSeconds(Int32)

Increments or decrements the second.

public : void AddSeconds(int seconds)
void AddSeconds(int32_t seconds) const;
public void AddSeconds(Int32 seconds)
Public Function AddSeconds(seconds As Int32) As void
calendar.addSeconds(seconds);
Parameters
seconds
Int32 Int32 Int32

The number of seconds by which to increment the second (if the value is positive) or decrement the second (if the value is negative).

AddWeeks(Int32) AddWeeks(Int32) AddWeeks(Int32) AddWeeks(Int32) AddWeeks(Int32)

Increments or decrements the day by the specified number of weeks.

public : void AddWeeks(int weeks)
void AddWeeks(int32_t weeks) const;
public void AddWeeks(Int32 weeks)
Public Function AddWeeks(weeks As Int32) As void
calendar.addWeeks(weeks);
Parameters
weeks
Int32 Int32 Int32

The number of weeks by which to increment the day (if the value is positive) or decrement the day (if the value is negative).

AddYears(Int32) AddYears(Int32) AddYears(Int32) AddYears(Int32) AddYears(Int32)

Increments or decrements the year.

public : void AddYears(int years)
void AddYears(int32_t years) const;
public void AddYears(Int32 years)
Public Function AddYears(years As Int32) As void
calendar.addYears(years);
Parameters
years
Int32 Int32 Int32

The number of years by which to increment the year (if the value is positive) or decrement the year (if the value is negative).

ChangeCalendarSystem(String) ChangeCalendarSystem(String) ChangeCalendarSystem(String) ChangeCalendarSystem(String) ChangeCalendarSystem(String)

Sets a new calendar system to be used by this Calendar object.

public : void ChangeCalendarSystem(Platform::String value)
void ChangeCalendarSystem(winrt::hstring value) const;
public void ChangeCalendarSystem(String value)
Public Function ChangeCalendarSystem(value As String) As void
calendar.changeCalendarSystem(value);
Parameters
value
String String String

The calendar identifier to use.

ChangeClock(String) ChangeClock(String) ChangeClock(String) ChangeClock(String) ChangeClock(String)

Sets a new clock to be used by this Calendar object.

public : void ChangeClock(Platform::String value)
void ChangeClock(winrt::hstring value) const;
public void ChangeClock(String value)
Public Function ChangeClock(value As String) As void
calendar.changeClock(value);
Parameters
value
String String String

The clock identifier to use.

ChangeTimeZone(String) ChangeTimeZone(String) ChangeTimeZone(String) ChangeTimeZone(String) ChangeTimeZone(String)

Sets a new time zone to be used by this Calendar object.

public : void ChangeTimeZone(Platform::String timeZoneId)
void ChangeTimeZone(winrt::hstring timeZoneId) const;
public void ChangeTimeZone(String timeZoneId)
Public Function ChangeTimeZone(timeZoneId As String) As void
calendar.changeTimeZone(timeZoneId);
Parameters
timeZoneId
String String String

An identifier from the IANA Time Zone Database which identifies the time zone that should be used (for example, "America/Los_Angeles" for Pacific Time).

Remarks

The values of other properties of this Calendar object may change as a result.

Clone() Clone() Clone() Clone() Clone()

Creates a copy of the Calendar object.

public : Calendar Clone()
Calendar Clone() const;
public Calendar Clone()
Public Function Clone() As Calendar
var calendar = calendar.clone();
Returns

Compare(Calendar) Compare(Calendar) Compare(Calendar) Compare(Calendar) Compare(Calendar)

Compares this calendar to another Calendar object and indicates whether the date and time of one is earlier, equal to, or later than that of the other.

public : int Compare(Calendar other)
int32_t Compare(Calendar other) const;
public int Compare(Calendar other)
Public Function Compare(other As Calendar) As int
var int = calendar.compare(other);
Parameters
other
Calendar Calendar Calendar Calendar Calendar

The Calendar object to compare to the current calendar.

Returns
int int int

One of the following values:

Return valueDescription
Less than zeroThe date and time of this calendar is earlier than that of other.
ZeroThe date and times are equal.
Greater than zeroThe date and time of this calendar is later than that of other.

CompareDateTime(DateTime) CompareDateTime(DateTime) CompareDateTime(DateTime) CompareDateTime(DateTime) CompareDateTime(DateTime)

Compares this calendar to a DateTime object and indicates whether the date and time of one is earlier, equal to, or later than that of the other.

public : int CompareDateTime(DateTime other)
int32_t CompareDateTime(DateTime other) const;
public int CompareDateTime(DateTimeOffset other)
Public Function CompareDateTime(other As DateTimeOffset) As int
var int = calendar.compareDateTime(other);
Parameters
other
DateTimeOffset DateTimeOffset DateTimeOffset

The DateTime object to compare to the current calendar.

Returns
int int int

One of the following values:

Return valueDescription
Less than zeroThe date and time of this calendar is earlier than that of other.
ZeroThe date and times are equal.
Greater than zeroThe date and time of this calendar is later than that of other.

CopyTo(Calendar) CopyTo(Calendar) CopyTo(Calendar) CopyTo(Calendar) CopyTo(Calendar)

Copies the values from another Calendar object into this Calendar.

public : void CopyTo(Calendar other)
void CopyTo(Calendar other) const;
public void CopyTo(Calendar other)
Public Function CopyTo(other As Calendar) As void
calendar.copyTo(other);
Parameters
other
Calendar Calendar Calendar Calendar Calendar

The Calendar object to be copied.

DayAsPaddedString(Int32) DayAsPaddedString(Int32) DayAsPaddedString(Int32) DayAsPaddedString(Int32) DayAsPaddedString(Int32)

Returns a string representation of the day, optionally zero-padded.

public : Platform::String DayAsPaddedString(int minDigits)
winrt::hstring DayAsPaddedString(int32_t minDigits) const;
public string DayAsPaddedString(Int32 minDigits)
Public Function DayAsPaddedString(minDigits As Int32) As string
var string = calendar.dayAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the day does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the day 3, a parameter of 1 returns 3, and a parameter of 2 returns 03.

Returns
string string string

A string representation of the day.

DayAsString() DayAsString() DayAsString() DayAsString() DayAsString()

Returns a string that contains the numeric representation of the day.

public : Platform::String DayAsString()
winrt::hstring DayAsString() const;
public string DayAsString()
Public Function DayAsString() As string
var string = calendar.dayAsString();
Returns
string string string

A string representation of the day.

DayOfWeekAsSoloString() DayOfWeekAsSoloString() DayOfWeekAsSoloString() DayOfWeekAsSoloString() DayOfWeekAsSoloString()

Returns a string representation of the day of the week suitable for stand-alone display.

public : Platform::String DayOfWeekAsSoloString()
winrt::hstring DayOfWeekAsSoloString() const;
public string DayOfWeekAsSoloString()
Public Function DayOfWeekAsSoloString() As string
var string = calendar.dayOfWeekAsSoloString();
Returns
string string string

A string representation of the day of the week, using the most common abbreviation available.

See Also

DayOfWeekAsSoloString(Int32) DayOfWeekAsSoloString(Int32) DayOfWeekAsSoloString(Int32) DayOfWeekAsSoloString(Int32) DayOfWeekAsSoloString(Int32)

Returns a string representation of the day of the week suitable for stand-alone display.

public : Platform::String DayOfWeekAsSoloString(int idealLength)
winrt::hstring DayOfWeekAsSoloString(int32_t idealLength) const;
public string DayOfWeekAsSoloString(Int32 idealLength)
Public Function DayOfWeekAsSoloString(idealLength As Int32) As string
var string = calendar.dayOfWeekAsSoloString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer specifying the ideal length, in characters, for the returned string, or 0 specifying the most common abbreviation available.

Returns
string string string

A string representation of the day of the week.

See Also

DayOfWeekAsString() DayOfWeekAsString() DayOfWeekAsString() DayOfWeekAsString() DayOfWeekAsString()

Returns a string representation of the day of the week suitable for inclusion with other date components.

public : Platform::String DayOfWeekAsString()
winrt::hstring DayOfWeekAsString() const;
public string DayOfWeekAsString()
Public Function DayOfWeekAsString() As string
var string = calendar.dayOfWeekAsString();
Returns
string string string

A string representation of the day of the week, using the most common abbreviation available.

See Also

DayOfWeekAsString(Int32) DayOfWeekAsString(Int32) DayOfWeekAsString(Int32) DayOfWeekAsString(Int32) DayOfWeekAsString(Int32)

Returns a string representation of the day of the week suitable for inclusion with other date components.

public : Platform::String DayOfWeekAsString(int idealLength)
winrt::hstring DayOfWeekAsString(int32_t idealLength) const;
public string DayOfWeekAsString(Int32 idealLength)
Public Function DayOfWeekAsString(idealLength As Int32) As string
var string = calendar.dayOfWeekAsString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer specifying the ideal length, in characters, for the returned string, or 0 specifying the most common abbreviation available.

Returns
string string string

A string representation of the day of the week.

See Also

EraAsString() EraAsString() EraAsString() EraAsString() EraAsString()

Returns a string representation of the era.

public : Platform::String EraAsString()
winrt::hstring EraAsString() const;
public string EraAsString()
Public Function EraAsString() As string
var string = calendar.eraAsString();
Returns
string string string

A string representation of the era, using the most common abbreviation available.

See Also

EraAsString(Int32) EraAsString(Int32) EraAsString(Int32) EraAsString(Int32) EraAsString(Int32)

Returns a string representation of the era. The string chosen is closest in length to the ideal length.

public : Platform::String EraAsString(int idealLength)
winrt::hstring EraAsString(int32_t idealLength) const;
public string EraAsString(Int32 idealLength)
Public Function EraAsString(idealLength As Int32) As string
var string = calendar.eraAsString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer specifying the ideal length, in characters, for the returned string, or 0 specifying the most common abbreviation available.

Returns
string string string

A string representation of the era.

See Also

GetCalendarSystem() GetCalendarSystem() GetCalendarSystem() GetCalendarSystem() GetCalendarSystem()

Gets the calendar system that is used by this Calendar object.

public : Platform::String GetCalendarSystem()
winrt::hstring GetCalendarSystem() const;
public string GetCalendarSystem()
Public Function GetCalendarSystem() As string
var string = calendar.getCalendarSystem();
Returns
string string string

The identifier of the calendar system.

GetClock() GetClock() GetClock() GetClock() GetClock()

Gets the clock that is used by this Calendar object.

public : Platform::String GetClock()
winrt::hstring GetClock() const;
public string GetClock()
Public Function GetClock() As string
var string = calendar.getClock();
Returns
string string string

The identifier of the clock.

GetDateTime() GetDateTime() GetDateTime() GetDateTime() GetDateTime()

Builds a date and time, given the components of this Calendar object.

public : DateTime GetDateTime()
DateTime GetDateTime() const;
public DateTimeOffset GetDateTime()
Public Function GetDateTime() As DateTimeOffset
var dateTime = calendar.getDateTime();
Returns
DateTimeOffset DateTimeOffset DateTimeOffset

The DateTime representing the date and time of this Calendar.

GetTimeZone() GetTimeZone() GetTimeZone() GetTimeZone() GetTimeZone()

Gets the identifier that identifies the time zone that is used by this Calendar object.

public : Platform::String GetTimeZone()
winrt::hstring GetTimeZone() const;
public string GetTimeZone()
Public Function GetTimeZone() As string
var string = calendar.getTimeZone();
Returns
string string string

The identifier from the IANA Time Zone Database that identifies the time zone that is used by this Calendar object. (An example is "America/Los_Angeles" for Pacific Time.)

HourAsPaddedString(Int32) HourAsPaddedString(Int32) HourAsPaddedString(Int32) HourAsPaddedString(Int32) HourAsPaddedString(Int32)

Returns a string representation of the hour, optionally zero-padded.

public : Platform::String HourAsPaddedString(int minDigits)
winrt::hstring HourAsPaddedString(int32_t minDigits) const;
public string HourAsPaddedString(Int32 minDigits)
Public Function HourAsPaddedString(minDigits As Int32) As string
var string = calendar.hourAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the hour does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the hour 3, a parameter of 1 returns 3, and a parameter of 2 returns 03.

Returns
string string string

A string representation of the hour.

HourAsString() HourAsString() HourAsString() HourAsString() HourAsString()

Returns a string that contains the numeric representation of the hour.

public : Platform::String HourAsString()
winrt::hstring HourAsString() const;
public string HourAsString()
Public Function HourAsString() As string
var string = calendar.hourAsString();
Returns
string string string

A string representation of the hour.

MinuteAsPaddedString(Int32) MinuteAsPaddedString(Int32) MinuteAsPaddedString(Int32) MinuteAsPaddedString(Int32) MinuteAsPaddedString(Int32)

Returns a string representation of the minute, optionally zero-padded.

public : Platform::String MinuteAsPaddedString(int minDigits)
winrt::hstring MinuteAsPaddedString(int32_t minDigits) const;
public string MinuteAsPaddedString(Int32 minDigits)
Public Function MinuteAsPaddedString(minDigits As Int32) As string
var string = calendar.minuteAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the minute does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the minute 3, a parameter of 1 returns 3, and a parameter of 2 returns 03.

Returns
string string string

A string representation of the minute.

MinuteAsString() MinuteAsString() MinuteAsString() MinuteAsString() MinuteAsString()

Returns a string that contains the numeric representation of the minute.

public : Platform::String MinuteAsString()
winrt::hstring MinuteAsString() const;
public string MinuteAsString()
Public Function MinuteAsString() As string
var string = calendar.minuteAsString();
Returns
string string string

A string representation of the minute.

MonthAsNumericString() MonthAsNumericString() MonthAsNumericString() MonthAsNumericString() MonthAsNumericString()

Returns a string that contains the numeric representation of the month.

public : Platform::String MonthAsNumericString()
winrt::hstring MonthAsNumericString() const;
public string MonthAsNumericString()
Public Function MonthAsNumericString() As string
var string = calendar.monthAsNumericString();
Returns
string string string

A string representation of the month.

MonthAsPaddedNumericString(Int32) MonthAsPaddedNumericString(Int32) MonthAsPaddedNumericString(Int32) MonthAsPaddedNumericString(Int32) MonthAsPaddedNumericString(Int32)

Returns a string representation of the month, optionally zero-padded.

public : Platform::String MonthAsPaddedNumericString(int minDigits)
winrt::hstring MonthAsPaddedNumericString(int32_t minDigits) const;
public string MonthAsPaddedNumericString(Int32 minDigits)
Public Function MonthAsPaddedNumericString(minDigits As Int32) As string
var string = calendar.monthAsPaddedNumericString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the month does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the month 3, a parameter of 1 returns 3, and a parameter of 2 returns 03.

Returns
string string string

A string representation of the month.

MonthAsSoloString() MonthAsSoloString() MonthAsSoloString() MonthAsSoloString() MonthAsSoloString()

Returns a string representation of the month suitable for stand-alone display.

public : Platform::String MonthAsSoloString()
winrt::hstring MonthAsSoloString() const;
public string MonthAsSoloString()
Public Function MonthAsSoloString() As string
var string = calendar.monthAsSoloString();
Returns
string string string

A string representation of the month, using the most common abbreviation available.

See Also

MonthAsSoloString(Int32) MonthAsSoloString(Int32) MonthAsSoloString(Int32) MonthAsSoloString(Int32) MonthAsSoloString(Int32)

Returns a string representation of the month suitable for stand-alone display.

public : Platform::String MonthAsSoloString(int idealLength)
winrt::hstring MonthAsSoloString(int32_t idealLength) const;
public string MonthAsSoloString(Int32 idealLength)
Public Function MonthAsSoloString(idealLength As Int32) As string
var string = calendar.monthAsSoloString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer specifying the ideal length, in characters, for the returned string, or 0 specifying the most common abbreviation available.

Returns
string string string

A string representation of the month.

See Also

MonthAsString() MonthAsString() MonthAsString() MonthAsString() MonthAsString()

Returns a string representation of the month suitable for inclusion with other date components.

public : Platform::String MonthAsString()
winrt::hstring MonthAsString() const;
public string MonthAsString()
Public Function MonthAsString() As string
var string = calendar.monthAsString();
Returns
string string string

A string representation of the month, using the most common abbreviation available.

See Also

MonthAsString(Int32) MonthAsString(Int32) MonthAsString(Int32) MonthAsString(Int32) MonthAsString(Int32)

Returns a string representation of the month suitable for inclusion with other date components.

public : Platform::String MonthAsString(int idealLength)
winrt::hstring MonthAsString(int32_t idealLength) const;
public string MonthAsString(Int32 idealLength)
Public Function MonthAsString(idealLength As Int32) As string
var string = calendar.monthAsString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer specifying the ideal length, in characters, for the returned string, or 0 specifying the most common abbreviation available.

Returns
string string string

A string representation of the month.

See Also

NanosecondAsPaddedString(Int32) NanosecondAsPaddedString(Int32) NanosecondAsPaddedString(Int32) NanosecondAsPaddedString(Int32) NanosecondAsPaddedString(Int32)

Returns a string representation of the nanosecond, optionally zero-padded.

public : Platform::String NanosecondAsPaddedString(int minDigits)
winrt::hstring NanosecondAsPaddedString(int32_t minDigits) const;
public string NanosecondAsPaddedString(Int32 minDigits)
Public Function NanosecondAsPaddedString(minDigits As Int32) As string
var string = calendar.nanosecondAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the nanosecond does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the nanosecond 42, a parameter of 1 or 2 returns 42, and a parameter of 3 returns 042.

Returns
string string string

A string representation of the nanosecond.

NanosecondAsString() NanosecondAsString() NanosecondAsString() NanosecondAsString() NanosecondAsString()

Returns a string that contains the numeric representation of the nanosecond.

public : Platform::String NanosecondAsString()
winrt::hstring NanosecondAsString() const;
public string NanosecondAsString()
Public Function NanosecondAsString() As string
var string = calendar.nanosecondAsString();
Returns
string string string

A string representation of the nanosecond.

PeriodAsString() PeriodAsString() PeriodAsString() PeriodAsString() PeriodAsString()

Returns a string representation of the day period, such as AM or PM, that uses the most common abbreviation available.

public : Platform::String PeriodAsString()
winrt::hstring PeriodAsString() const;
public string PeriodAsString()
Public Function PeriodAsString() As string
var string = calendar.periodAsString();
Returns
string string string

A string representation of the day period.

See Also

PeriodAsString(Int32) PeriodAsString(Int32) PeriodAsString(Int32) PeriodAsString(Int32) PeriodAsString(Int32)

Returns a string representation of the day period, such as AM or PM.

public : Platform::String PeriodAsString(int idealLength)
winrt::hstring PeriodAsString(int32_t idealLength) const;
public string PeriodAsString(Int32 idealLength)
Public Function PeriodAsString(idealLength As Int32) As string
var string = calendar.periodAsString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

A positive integer that specifies the ideal length, in characters, for the returned string; or a zero that specifies the most common abbreviation available.

Returns
string string string

A string representation for the day period.

See Also

SecondAsPaddedString(Int32) SecondAsPaddedString(Int32) SecondAsPaddedString(Int32) SecondAsPaddedString(Int32) SecondAsPaddedString(Int32)

Returns a string representation of the second, optionally zero-padded.

public : Platform::String SecondAsPaddedString(int minDigits)
winrt::hstring SecondAsPaddedString(int32_t minDigits) const;
public string SecondAsPaddedString(Int32 minDigits)
Public Function SecondAsPaddedString(minDigits As Int32) As string
var string = calendar.secondAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the second does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the second 3, a parameter of 1 returns 3, and a parameter of 2 returns 03.

Returns
string string string

A string representation of the second.

SecondAsString() SecondAsString() SecondAsString() SecondAsString() SecondAsString()

Returns a string that contains the numeric representation of the second.

public : Platform::String SecondAsString()
winrt::hstring SecondAsString() const;
public string SecondAsString()
Public Function SecondAsString() As string
var string = calendar.secondAsString();
Returns
string string string

A string representation of the second.

SetDateTime(DateTime) SetDateTime(DateTime) SetDateTime(DateTime) SetDateTime(DateTime) SetDateTime(DateTime)

Sets all the date and time fields to the date and time represented by the DateTime parameter.

public : void SetDateTime(DateTime value)
void SetDateTime(DateTime value) const;
public void SetDateTime(DateTimeOffset value)
Public Function SetDateTime(value As DateTimeOffset) As void
calendar.setDateTime(value);
Parameters
value
DateTimeOffset DateTimeOffset DateTimeOffset

The DateTime that is used to set all of the date and time fields.

SetToMax() SetToMax() SetToMax() SetToMax() SetToMax()

Sets the components of this Calendar object to the latest date and time that are supported.

public : void SetToMax()
void SetToMax() const;
public void SetToMax()
Public Function SetToMax() As void
calendar.setToMax();

SetToMin() SetToMin() SetToMin() SetToMin() SetToMin()

Sets the components of this Calendar object to the earliest date and time that are supported.

public : void SetToMin()
void SetToMin() const;
public void SetToMin()
Public Function SetToMin() As void
calendar.setToMin();

SetToNow() SetToNow() SetToNow() SetToNow() SetToNow()

Sets the components of this Calendar object to the current date and time.

public : void SetToNow()
void SetToNow() const;
public void SetToNow()
Public Function SetToNow() As void
calendar.setToNow();

TimeZoneAsString() TimeZoneAsString() TimeZoneAsString() TimeZoneAsString() TimeZoneAsString()

Returns the full time zone name applicable at the instant of time that this Calendar object represents.

public : Platform::String TimeZoneAsString()
winrt::hstring TimeZoneAsString() const;
public string TimeZoneAsString()
Public Function TimeZoneAsString() As string
var string = calendar.timeZoneAsString();
Returns
string string string

The full time zone name. This usually differs depending on whether the time zone is observing Daylight Saving Time or not. It also may differ due to historical changes. (An example is "America/Los_Angeles" for Pacific Time.)

See Also

TimeZoneAsString(Int32) TimeZoneAsString(Int32) TimeZoneAsString(Int32) TimeZoneAsString(Int32) TimeZoneAsString(Int32)

Returns the abbreviated time zone name applicable at the instant of time that this Calendar object represents.

public : Platform::String TimeZoneAsString(int idealLength)
winrt::hstring TimeZoneAsString(int32_t idealLength) const;
public string TimeZoneAsString(Int32 idealLength)
Public Function TimeZoneAsString(idealLength As Int32) As string
var string = calendar.timeZoneAsString(idealLength);
Parameters
idealLength
Int32 Int32 Int32

The desired length of the abbreviation to be returned. Use 0 to request the abbreviation in most common use.

Returns
string string string

The time zone abbreviation that is closest in length to idealLength. If there is a tie, the shorter abbreviation is returned. If idealLength is 0, the abbreviation in most common use is returned. (An example is "America/Los_Angeles" for Pacific Time.)

See Also

YearAsPaddedString(Int32) YearAsPaddedString(Int32) YearAsPaddedString(Int32) YearAsPaddedString(Int32) YearAsPaddedString(Int32)

Returns a string representation of the year, optionally zero-padded.

public : Platform::String YearAsPaddedString(int minDigits)
winrt::hstring YearAsPaddedString(int32_t minDigits) const;
public string YearAsPaddedString(Int32 minDigits)
Public Function YearAsPaddedString(minDigits As Int32) As string
var string = calendar.yearAsPaddedString(minDigits);
Parameters
minDigits
Int32 Int32 Int32

The minimum number of integer digits to be displayed. If the year does not have enough integer digits, it will be padded with zeros to the correct amount. For example, for the year 42, a parameter of 1 or 2 returns 42, and a parameter of 3 returns 042.

Returns
string string string

A string representation of the year.

YearAsString() YearAsString() YearAsString() YearAsString() YearAsString()

Returns a string representation of the year without any initial zero padding.

public : Platform::String YearAsString()
winrt::hstring YearAsString() const;
public string YearAsString()
Public Function YearAsString() As string
var string = calendar.yearAsString();
Returns
string string string

A string representation of the year.

YearAsTruncatedString(Int32) YearAsTruncatedString(Int32) YearAsTruncatedString(Int32) YearAsTruncatedString(Int32) YearAsTruncatedString(Int32)

Returns a string representation of the year, optionally truncated.

public : Platform::String YearAsTruncatedString(int remainingDigits)
winrt::hstring YearAsTruncatedString(int32_t remainingDigits) const;
public string YearAsTruncatedString(Int32 remainingDigits)
Public Function YearAsTruncatedString(remainingDigits As Int32) As string
var string = calendar.yearAsTruncatedString(remainingDigits);
Parameters
remainingDigits
Int32 Int32 Int32

A positive integer that represents the number of least significant digits that should be included. For example, for the year 1234, a parameter of 2 returns 34, and a parameter of 4 or larger returns 1234.

Returns
string string string

A string representation of the year.

See Also