Calendar Calendar Calendar Class

Definition

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

public sealed class Calendar : ICalendar, ITimeZoneOnCalendarpublic sealed class Calendar : ICalendar, ITimeZoneOnCalendarPublic NotInheritable Class Calendar Implements ICalendar, ITimeZoneOnCalendar
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()

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

public Calendar()public Calendar()Public Sub New()
Attributes

Calendar(IIterable<String>) Calendar(IIterable<String>) Calendar(IIterable<String>)

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

public Calendar(IIterable<String> languages)public Calendar(IIterable<String> languages)Public Sub New(languages As IIterable<String>)
Parameters
languages

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

Attributes

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, and clock.

public Calendar(IIterable<String> languages, String calendar, String clock)public Calendar(IIterable<String> languages, String calendar, String clock)Public Sub New(languages As IIterable<String>, calendar As String, clock As String)
Parameters
languages

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

calendar
System.String System.String System.String

The calendar identifier to use.

clock
System.String System.String System.String

The clock identifier to use.

Attributes
See Also

Calendar(IIterable<String>, String, String, String) Calendar(IIterable<String>, String, String, String) Calendar(IIterable<String>, String, String, String)

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

public Calendar(IIterable<String> languages, String calendar, String clock, String timeZoneId)public Calendar(IIterable<String> languages, String calendar, String clock, String timeZoneId)Public Sub New(languages As IIterable<String>, calendar As String, clock As String, timeZoneId As String)
Parameters
languages

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

calendar
System.String System.String System.String

The calendar identifier to use.

clock
System.String System.String System.String

The clock identifier to use.

timeZoneId
System.String System.String System.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).

Attributes

Properties

Day Day Day

Gets or sets the day.

public int Day { get; set; }public int Day { get; set; }Public ReadWrite Property Day As int
Value
int int int

The day.

Attributes

DayOfWeek DayOfWeek DayOfWeek

Gets the day of the week.

public DayOfWeek DayOfWeek { get; }public DayOfWeek DayOfWeek { get; }Public ReadOnly Property DayOfWeek As DayOfWeek
Value
DayOfWeek DayOfWeek DayOfWeek

The day of the week.

Attributes

Era Era Era

Gets or sets the era.

public int Era { get; set; }public int Era { get; set; }Public ReadWrite Property Era As int
Value
int int int

The integer that represents the era.

Attributes

FirstDayInThisMonth FirstDayInThisMonth FirstDayInThisMonth

Gets the first Day of the current Month.

public int FirstDayInThisMonth { get; }public int FirstDayInThisMonth { get; }Public ReadOnly Property FirstDayInThisMonth As int
Value
int int int

The first Day of the current Month.

Attributes

FirstEra FirstEra FirstEra

Gets the first Era available in the calendar.

public int FirstEra { get; }public int FirstEra { get; }Public ReadOnly Property FirstEra As int
Value
int int int

The first Era in the calendar.

Attributes

FirstHourInThisPeriod FirstHourInThisPeriod FirstHourInThisPeriod

Gets the first Hour of the current Period.

public int FirstHourInThisPeriod { get; }public int FirstHourInThisPeriod { get; }Public ReadOnly Property FirstHourInThisPeriod As int
Value
int int int

The first Hour of the current Period.

Attributes

FirstMinuteInThisHour FirstMinuteInThisHour FirstMinuteInThisHour

Gets the first Minute of the current Hour.

public int FirstMinuteInThisHour { get; }public int FirstMinuteInThisHour { get; }Public ReadOnly Property FirstMinuteInThisHour As int
Value
int int int

The first Minute of the current Hour.

Attributes

FirstMonthInThisYear FirstMonthInThisYear FirstMonthInThisYear

Gets the first Month of the current Year.

public int FirstMonthInThisYear { get; }public int FirstMonthInThisYear { get; }Public ReadOnly Property FirstMonthInThisYear As int
Value
int int int

The first Month of the current Year.

Attributes

FirstPeriodInThisDay FirstPeriodInThisDay FirstPeriodInThisDay

Gets the first Period of the current Day.

public int FirstPeriodInThisDay { get; }public int FirstPeriodInThisDay { get; }Public ReadOnly Property FirstPeriodInThisDay As int
Value
int int int

The first Period of the current Day.

Attributes

FirstSecondInThisMinute FirstSecondInThisMinute FirstSecondInThisMinute

Gets the first Second of the current Minute.

public int FirstSecondInThisMinute { get; }public int FirstSecondInThisMinute { get; }Public ReadOnly Property FirstSecondInThisMinute As int
Value
int int int

The first Second of the current Minute.

Attributes

FirstYearInThisEra FirstYearInThisEra FirstYearInThisEra

Gets the first Year of the current Era.

public int FirstYearInThisEra { get; }public int FirstYearInThisEra { get; }Public ReadOnly Property FirstYearInThisEra As int
Value
int int int

The first Year of the current Era.

Attributes

Hour Hour Hour

Gets or sets the hour.

public int Hour { get; set; }public int Hour { get; set; }Public ReadWrite Property Hour As int
Value
int int int

The hour.

Attributes

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; }public bool IsDaylightSavingTime { get; }Public ReadOnly Property IsDaylightSavingTime As bool
Value
bool bool bool

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

Attributes

Languages Languages Languages

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

public IVectorView<string> Languages { get; }public IVectorView<string> Languages { get; }Public ReadOnly Property Languages As IVectorView<string>
Value

The list of language identifiers.

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

Attributes

LastDayInThisMonth LastDayInThisMonth LastDayInThisMonth

Gets the last Day of the current Month.

public int LastDayInThisMonth { get; }public int LastDayInThisMonth { get; }Public ReadOnly Property LastDayInThisMonth As int
Value
int int int

The last Day of the current Month.

Attributes

LastEra LastEra LastEra

Gets the last Era available in the calendar.

public int LastEra { get; }public int LastEra { get; }Public ReadOnly Property LastEra As int
Value
int int int

The last Era in the calendar.

Attributes

LastHourInThisPeriod LastHourInThisPeriod LastHourInThisPeriod

Gets the last Hour of the current Period.

public int LastHourInThisPeriod { get; }public int LastHourInThisPeriod { get; }Public ReadOnly Property LastHourInThisPeriod As int
Value
int int int

The last Hour of the current Period.

Attributes

LastMinuteInThisHour LastMinuteInThisHour LastMinuteInThisHour

Gets the last Minute of the current Hour.

public int LastMinuteInThisHour { get; }public int LastMinuteInThisHour { get; }Public ReadOnly Property LastMinuteInThisHour As int
Value
int int int

The last Minute of the current Hour.

Attributes

LastMonthInThisYear LastMonthInThisYear LastMonthInThisYear

Gets the last Month of the current Year.

public int LastMonthInThisYear { get; }public int LastMonthInThisYear { get; }Public ReadOnly Property LastMonthInThisYear As int
Value
int int int

The last Month of the current Year.

Attributes

LastPeriodInThisDay LastPeriodInThisDay LastPeriodInThisDay

Gets the last Period of the current Day.

public int LastPeriodInThisDay { get; }public int LastPeriodInThisDay { get; }Public ReadOnly Property LastPeriodInThisDay As int
Value
int int int

The last Period of the current Day.

Attributes

LastSecondInThisMinute LastSecondInThisMinute LastSecondInThisMinute

Gets the last Second of the current Minute.

public int LastSecondInThisMinute { get; }public int LastSecondInThisMinute { get; }Public ReadOnly Property LastSecondInThisMinute As int
Value
int int int

The last Second of the current Minute.

Attributes

LastYearInThisEra LastYearInThisEra LastYearInThisEra

Gets the last Year of the current Era.

public int LastYearInThisEra { get; }public int LastYearInThisEra { get; }Public ReadOnly Property LastYearInThisEra As int
Value
int int int

The last Year of the current Era.

Attributes

Minute Minute Minute

Gets or sets the minute.

public int Minute { get; set; }public int Minute { get; set; }Public ReadWrite Property Minute As int
Value
int int int

The minute.

Attributes

Month Month Month

Gets or sets the month.

public int Month { get; set; }public int Month { get; set; }Public ReadWrite Property Month As int
Value
int int int

The month.

Attributes

Nanosecond Nanosecond Nanosecond

Gets or sets the nanosecond.

public int Nanosecond { get; set; }public int Nanosecond { get; set; }Public ReadWrite Property Nanosecond As int
Value
int int int

The nanosecond.

Attributes

NumberOfDaysInThisMonth NumberOfDaysInThisMonth NumberOfDaysInThisMonth

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

public int NumberOfDaysInThisMonth { get; }public int NumberOfDaysInThisMonth { get; }Public ReadOnly Property NumberOfDaysInThisMonth As int
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.

Attributes

NumberOfEras NumberOfEras NumberOfEras

Gets the number of eras in this Calendar object.

public int NumberOfEras { get; }public int NumberOfEras { get; }Public ReadOnly Property NumberOfEras As int
Value
int int int

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

Attributes

NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod NumberOfHoursInThisPeriod

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

public int NumberOfHoursInThisPeriod { get; }public int NumberOfHoursInThisPeriod { get; }Public ReadOnly Property NumberOfHoursInThisPeriod As int
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.

Attributes

NumberOfMinutesInThisHour NumberOfMinutesInThisHour NumberOfMinutesInThisHour

Gets the number of Minute s in the current Hour.

public int NumberOfMinutesInThisHour { get; }public int NumberOfMinutesInThisHour { get; }Public ReadOnly Property NumberOfMinutesInThisHour As int
Value
int int int

The number of Minute s in the current Hour.

Attributes

NumberOfMonthsInThisYear NumberOfMonthsInThisYear NumberOfMonthsInThisYear

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

public int NumberOfMonthsInThisYear { get; }public int NumberOfMonthsInThisYear { get; }Public ReadOnly Property NumberOfMonthsInThisYear As int
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.

Attributes

NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay NumberOfPeriodsInThisDay

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

public int NumberOfPeriodsInThisDay { get; }public int NumberOfPeriodsInThisDay { get; }Public ReadOnly Property NumberOfPeriodsInThisDay As int
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.

Attributes

NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute NumberOfSecondsInThisMinute

Gets the number of Second s in the current Minute.

public int NumberOfSecondsInThisMinute { get; }public int NumberOfSecondsInThisMinute { get; }Public ReadOnly Property NumberOfSecondsInThisMinute As int
Value
int int int

The number of Second s in the current Minute.

Attributes

NumberOfYearsInThisEra NumberOfYearsInThisEra NumberOfYearsInThisEra

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

public int NumberOfYearsInThisEra { get; }public int NumberOfYearsInThisEra { get; }Public ReadOnly Property NumberOfYearsInThisEra As int
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.

Attributes

NumeralSystem NumeralSystem NumeralSystem

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

public PlatForm::String NumeralSystem { get; set; }public string NumeralSystem { get; set; }Public ReadWrite Property NumeralSystem As 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.

Attributes
See Also

Period Period Period

Gets or sets the period of the current day.

public int Period { get; set; }public int Period { get; set; }Public ReadWrite Property Period As 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.

Attributes

ResolvedLanguage ResolvedLanguage ResolvedLanguage

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

public PlatForm::String ResolvedLanguage { get; }public string ResolvedLanguage { get; }Public ReadOnly Property ResolvedLanguage As string
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.

Attributes

Second Second Second

Gets or sets the second.

public int Second { get; set; }public int Second { get; set; }Public ReadWrite Property Second As int
Value
int int int

The second.

Attributes

Year Year Year

Gets or sets the year.

public int Year { get; set; }public int Year { get; set; }Public ReadWrite Property Year As int
Value
int int int

The year.

Attributes

Methods

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

Increments or decrements the day.

public void AddDays(Int32 days)public void AddDays(Int32 days)Public Function AddDays(days As Int32) As void
Parameters
days
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the era.

public void AddEras(Int32 eras)public void AddEras(Int32 eras)Public Function AddEras(eras As Int32) As void
Parameters
eras
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the hour.

public void AddHours(Int32 hours)public void AddHours(Int32 hours)Public Function AddHours(hours As Int32) As void
Parameters
hours
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the minute.

public void AddMinutes(Int32 minutes)public void AddMinutes(Int32 minutes)Public Function AddMinutes(minutes As Int32) As void
Parameters
minutes
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the month.

public void AddMonths(Int32 months)public void AddMonths(Int32 months)Public Function AddMonths(months As Int32) As void
Parameters
months
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the nanosecond.

public void AddNanoseconds(Int32 nanoseconds)public void AddNanoseconds(Int32 nanoseconds)Public Function AddNanoseconds(nanoseconds As Int32) As void
Parameters
nanoseconds
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the period.

public void AddPeriods(Int32 periods)public void AddPeriods(Int32 periods)Public Function AddPeriods(periods As Int32) As void
Parameters
periods
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the second.

public void AddSeconds(Int32 seconds)public void AddSeconds(Int32 seconds)Public Function AddSeconds(seconds As Int32) As void
Parameters
seconds
System.Int32 System.Int32 System.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).

Attributes

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

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

public void AddWeeks(Int32 weeks)public void AddWeeks(Int32 weeks)Public Function AddWeeks(weeks As Int32) As void
Parameters
weeks
System.Int32 System.Int32 System.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).

Attributes

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

Increments or decrements the year.

public void AddYears(Int32 years)public void AddYears(Int32 years)Public Function AddYears(years As Int32) As void
Parameters
years
System.Int32 System.Int32 System.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).

Attributes

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

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

public void ChangeCalendarSystem(String value)public void ChangeCalendarSystem(String value)Public Function ChangeCalendarSystem(value As String) As void
Parameters
value
System.String System.String System.String

The calendar identifier to use.

Attributes

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

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

public void ChangeClock(String value)public void ChangeClock(String value)Public Function ChangeClock(value As String) As void
Parameters
value
System.String System.String System.String

The clock identifier to use.

Attributes

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

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

public void ChangeTimeZone(String timeZoneId)public void ChangeTimeZone(String timeZoneId)Public Function ChangeTimeZone(timeZoneId As String) As void
Parameters
timeZoneId
System.String System.String System.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).

Attributes

Remarks

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

Clone() Clone() Clone()

Creates a copy of the Calendar object.

public Calendar Clone()public Calendar Clone()Public Function Clone() As Calendar
Returns
Attributes

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)public int Compare(Calendar other)Public Function Compare(other As Calendar) As int
Parameters
other
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.
Attributes

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)public int CompareDateTime(DateTime other)Public Function CompareDateTime(other As DateTime) As int
Parameters
other
DateTime DateTime DateTime

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.
Attributes

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

Copies the values from another Calendar object into this Calendar.

public void CopyTo(Calendar other)public void CopyTo(Calendar other)Public Function CopyTo(other As Calendar) As void
Parameters
other
Calendar Calendar Calendar

The Calendar object to be copied.

Attributes

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

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

public PlatForm::String DayAsPaddedString(Int32 minDigits)public string DayAsPaddedString(Int32 minDigits)Public Function DayAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

DayAsString() DayAsString() DayAsString()

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

public PlatForm::String DayAsString()public string DayAsString()Public Function DayAsString() As string
Returns
string string string

A string representation of the day.

Attributes

DayOfWeekAsSoloString() DayOfWeekAsSoloString() DayOfWeekAsSoloString()

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

public PlatForm::String DayOfWeekAsSoloString()public string DayOfWeekAsSoloString()Public Function DayOfWeekAsSoloString() As string
Returns
string string string

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

Attributes

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(Int32 idealLength)public string DayOfWeekAsSoloString(Int32 idealLength)Public Function DayOfWeekAsSoloString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

DayOfWeekAsString() DayOfWeekAsString() DayOfWeekAsString()

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

public PlatForm::String DayOfWeekAsString()public string DayOfWeekAsString()Public Function DayOfWeekAsString() As string
Returns
string string string

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

Attributes

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(Int32 idealLength)public string DayOfWeekAsString(Int32 idealLength)Public Function DayOfWeekAsString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

EraAsString() EraAsString() EraAsString()

Returns a string representation of the era.

public PlatForm::String EraAsString()public string EraAsString()Public Function EraAsString() As string
Returns
string string string

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

Attributes

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(Int32 idealLength)public string EraAsString(Int32 idealLength)Public Function EraAsString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

GetCalendarSystem() GetCalendarSystem() GetCalendarSystem()

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

public PlatForm::String GetCalendarSystem()public string GetCalendarSystem()Public Function GetCalendarSystem() As string
Returns
string string string

The identifier of the calendar system.

Attributes

GetClock() GetClock() GetClock()

Gets the clock that is used by this Calendar object.

public PlatForm::String GetClock()public string GetClock()Public Function GetClock() As string
Returns
string string string

The identifier of the clock.

Attributes

GetDateTime() GetDateTime() GetDateTime()

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

public DateTime GetDateTime()public DateTimeOffset GetDateTime()Public Function GetDateTime() As DateTimeOffset
Returns

The DateTime representing the date and time of this Calendar.

Attributes

GetTimeZone() GetTimeZone() GetTimeZone()

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

public PlatForm::String GetTimeZone()public string GetTimeZone()Public Function GetTimeZone() As string
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.)

Attributes

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

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

public PlatForm::String HourAsPaddedString(Int32 minDigits)public string HourAsPaddedString(Int32 minDigits)Public Function HourAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

HourAsString() HourAsString() HourAsString()

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

public PlatForm::String HourAsString()public string HourAsString()Public Function HourAsString() As string
Returns
string string string

A string representation of the hour.

Attributes

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

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

public PlatForm::String MinuteAsPaddedString(Int32 minDigits)public string MinuteAsPaddedString(Int32 minDigits)Public Function MinuteAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

MinuteAsString() MinuteAsString() MinuteAsString()

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

public PlatForm::String MinuteAsString()public string MinuteAsString()Public Function MinuteAsString() As string
Returns
string string string

A string representation of the minute.

Attributes

MonthAsNumericString() MonthAsNumericString() MonthAsNumericString()

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

public PlatForm::String MonthAsNumericString()public string MonthAsNumericString()Public Function MonthAsNumericString() As string
Returns
string string string

A string representation of the month.

Attributes

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

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

public PlatForm::String MonthAsPaddedNumericString(Int32 minDigits)public string MonthAsPaddedNumericString(Int32 minDigits)Public Function MonthAsPaddedNumericString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

MonthAsSoloString() MonthAsSoloString() MonthAsSoloString()

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

public PlatForm::String MonthAsSoloString()public string MonthAsSoloString()Public Function MonthAsSoloString() As string
Returns
string string string

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

Attributes

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

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

public PlatForm::String MonthAsSoloString(Int32 idealLength)public string MonthAsSoloString(Int32 idealLength)Public Function MonthAsSoloString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

MonthAsString() MonthAsString() MonthAsString()

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

public PlatForm::String MonthAsString()public string MonthAsString()Public Function MonthAsString() As string
Returns
string string string

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

Attributes

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

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

public PlatForm::String MonthAsString(Int32 idealLength)public string MonthAsString(Int32 idealLength)Public Function MonthAsString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

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

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

public PlatForm::String NanosecondAsPaddedString(Int32 minDigits)public string NanosecondAsPaddedString(Int32 minDigits)Public Function NanosecondAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

NanosecondAsString() NanosecondAsString() NanosecondAsString()

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

public PlatForm::String NanosecondAsString()public string NanosecondAsString()Public Function NanosecondAsString() As string
Returns
string string string

A string representation of the nanosecond.

Attributes

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()public string PeriodAsString()Public Function PeriodAsString() As string
Returns
string string string

A string representation of the day period.

Attributes

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

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

public PlatForm::String PeriodAsString(Int32 idealLength)public string PeriodAsString(Int32 idealLength)Public Function PeriodAsString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.

Attributes

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

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

public PlatForm::String SecondAsPaddedString(Int32 minDigits)public string SecondAsPaddedString(Int32 minDigits)Public Function SecondAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

SecondAsString() SecondAsString() SecondAsString()

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

public PlatForm::String SecondAsString()public string SecondAsString()Public Function SecondAsString() As string
Returns
string string string

A string representation of the second.

Attributes

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)public void SetDateTime(DateTime value)Public Function SetDateTime(value As DateTime) As void
Parameters
value
DateTime DateTime DateTime

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

Attributes

SetToMax() SetToMax() SetToMax()

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

public void SetToMax()public void SetToMax()Public Function SetToMax() As void
Attributes

SetToMin() SetToMin() SetToMin()

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

public void SetToMin()public void SetToMin()Public Function SetToMin() As void
Attributes

SetToNow() SetToNow() SetToNow()

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

public void SetToNow()public void SetToNow()Public Function SetToNow() As void
Attributes

TimeZoneAsString() TimeZoneAsString() TimeZoneAsString()

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

public PlatForm::String TimeZoneAsString()public string TimeZoneAsString()Public Function TimeZoneAsString() As string
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.)

Attributes

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(Int32 idealLength)public string TimeZoneAsString(Int32 idealLength)Public Function TimeZoneAsString(idealLength As Int32) As string
Parameters
idealLength
System.Int32 System.Int32 System.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.)

Attributes

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

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

public PlatForm::String YearAsPaddedString(Int32 minDigits)public string YearAsPaddedString(Int32 minDigits)Public Function YearAsPaddedString(minDigits As Int32) As string
Parameters
minDigits
System.Int32 System.Int32 System.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.

Attributes

YearAsString() YearAsString() YearAsString()

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

public PlatForm::String YearAsString()public string YearAsString()Public Function YearAsString() As string
Returns
string string string

A string representation of the year.

Attributes

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

Returns a string representation of the year, optionally truncated.

public PlatForm::String YearAsTruncatedString(Int32 remainingDigits)public string YearAsTruncatedString(Int32 remainingDigits)Public Function YearAsTruncatedString(remainingDigits As Int32) As string
Parameters
remainingDigits
System.Int32 System.Int32 System.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.

Attributes

See Also