Windows Dev Center

Développer Réduire

Calendar Class

Gère la représentation d'une date et d'une heure dans un calendrier et une horloge donnés.

Syntaxe


var calendar = new Windows.Globalization.Calendar(iIterable(String));
var calendar = new Windows.Globalization.Calendar(iIterable(String));
var calendar = new Windows.Globalization.Calendar(iIterable(String));
var calendar = new Windows.Globalization.Calendar();

Attributs

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Membres

CalendarClasse possède ces types de membres :

Constructeurs

CalendarClasse possède ces constructeurs.

ConstructeurDescription
Calendar() Creates a Calendar object and initializes it to the current date and time.
Calendar(IIterable(String)) Creates a Calendar object that is initialized with a language list.
Calendar(IIterable(String), String, String) Creates a Calendar object that is initialized with a language list, calendar, and clock.
Calendar(IIterable(String), String, String, String) Creates a Calendar object that is initialized with a language list, calendar, clock, and time zone.

 

Méthodes

The Calendar Classe a les méthodes suivantes. Avec C#, Visual Basic et C++, elle hérite également des méthodes de Object Classe.

MéthodeDescription
AddDays Increments or decrements the day.
AddEras Increments or decrements the era.
AddHours Increments or decrements the hour.
AddMinutes Increments or decrements the minute.
AddMonths Increments or decrements the month.
AddNanoseconds Increments or decrements the nanosecond.
AddPeriods Increments or decrements the period.
AddSeconds Increments or decrements the second.
AddWeeks Increments or decrements the day by the specified number of weeks.
AddYears Increments or decrements the year.
ChangeCalendarSystem Sets a new calendar system to be used by this Calendar object.
ChangeClock Sets a new clock to be used by this Calendar object.
ChangeTimeZone Sets a new time zone to be used by this Calendar object.
Clone Creates a copy of the Calendar object.
Compare 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.
CompareDateTime 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.
CopyTo Copies the values from another Calendar object into this Calendar.
DayAsPaddedString Returns a string representation of the day, optionally zero-padded.
DayAsString Returns a string that contains the numeric representation of the day.
DayOfWeekAsSoloString() Returns a string representation of the day of the week suitable for stand-alone display.
DayOfWeekAsSoloString(Int32) Returns a string representation of the day of the week suitable for stand-alone display.
DayOfWeekAsString() Returns a string representation of the day of the week suitable for inclusion with other date components.
DayOfWeekAsString(Int32) Returns a string representation of the day of the week suitable for inclusion with other date components.
EraAsString() Returns a string representation of the era.
EraAsString(Int32) Returns a string representation of the era. The string chosen is closest in length to the ideal length.
GetCalendarSystem Gets the calendar system that is used by this Calendar object.
GetClock Gets the clock that is used by this Calendar object.
GetDateTime Builds a date and time, given the components of this Calendar object.
GetTimeZone Gets the identifier that identifies the time zone that is used by this Calendar object.
HourAsPaddedString Returns a string representation of the hour, optionally zero-padded.
HourAsString Returns a string that contains the numeric representation of the hour.
MinuteAsPaddedString Returns a string representation of the minute, optionally zero-padded.
MinuteAsString Returns a string that contains the numeric representation of the minute.
MonthAsNumericString Returns a string that contains the numeric representation of the month.
MonthAsPaddedNumericString Returns a string representation of the month, optionally zero-padded.
MonthAsSoloString() Returns a string representation of the month suitable for stand-alone display.
MonthAsSoloString(Int32) Returns a string representation of the month suitable for stand-alone display.
MonthAsString() Returns a string representation of the month suitable for inclusion with other date components.
MonthAsString(Int32) Returns a string representation of the month suitable for inclusion with other date components.
NanosecondAsPaddedString Returns a string representation of the nanosecond, optionally zero-padded.
NanosecondAsString Returns a string that contains the numeric representation of the nanosecond.
PeriodAsString() Returns a string representation of the day period, such as AM or PM, that uses the most common abbreviation available.
PeriodAsString(Int32) Returns a string representation of the day period, such as AM or PM.
SecondAsPaddedString Returns a string representation of the second, optionally zero-padded.
SecondAsString Returns a string that contains the numeric representation of the second.
SetDateTime Sets all the date and time fields to the date and time represented by the DateTime parameter.
SetToMax Sets the components of this Calendar object to the latest date and time that are supported.
SetToMin Sets the components of this Calendar object to the earliest date and time that are supported.
SetToNow Sets the components of this Calendar object to the current date and time.
TimeZoneAsString() Returns the full time zone name applicable at the instant of time that this Calendar object represents.
TimeZoneAsString(Int32) Returns the abbreviated time zone name applicable at the instant of time that this Calendar object represents.
YearAsPaddedString Returns a string representation of the year, optionally zero-padded.
YearAsString Returns a string representation of the year without any initial zero padding.
YearAsTruncatedString Returns a string representation of the year, optionally truncated.

 

Propriétés

Le CalendarClasse a les propriétés suivantes.

PropriétéType d'accèsDescription

Day

Lecture/écritureGets or sets the day.

DayOfWeek

En lecture seuleGets the day of the week.

Era

Lecture/écritureGets or sets the era.

FirstDayInThisMonth

En lecture seuleGets the first Day of the current Month.

FirstEra

En lecture seuleGets the first Era available in the calendar.

FirstHourInThisPeriod

En lecture seuleGets the first Hour of the current Period.

FirstMinuteInThisHour

En lecture seuleGets the first Minute of the current Hour.

FirstMonthInThisYear

En lecture seuleGets the first Month of the current Year.

FirstPeriodInThisDay

En lecture seuleGets the first Period of the current Day.

FirstSecondInThisMinute

En lecture seuleGets the first Second of the current Minute.

FirstYearInThisEra

En lecture seuleGets the first Year of the current Era.

Hour

Lecture/écritureGets or sets the hour.

IsDaylightSavingTime

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

Languages

En lecture seuleGets the priority list of language identifiers that is used when formatting components as strings.

LastDayInThisMonth

En lecture seuleGets the last Day of the current Month.

LastEra

En lecture seuleGets the last Era available in the calendar.

LastHourInThisPeriod

En lecture seuleGets the last Hour of the current Period.

LastMinuteInThisHour

En lecture seuleGets the last Minute of the current Hour.

LastMonthInThisYear

En lecture seuleGets the last Month of the current Year.

LastPeriodInThisDay

En lecture seuleGets the last Period of the current Day.

LastSecondInThisMinute

En lecture seuleGets the last Second of the current Minute.

LastYearInThisEra

En lecture seuleGets the last Year of the current Era.

Minute

Lecture/écritureGets or sets the minute.

Month

Lecture/écritureGets or sets the month.

Nanosecond

Lecture/écritureGets or sets the nanosecond.

NumberOfDaysInThisMonth

En lecture seuleGets the number of days in the current month of this Calendar object.

NumberOfEras

En lecture seuleGets the number of eras in this Calendar object.

NumberOfHoursInThisPeriod

En lecture seuleGets the number of hours in the current day period of this Calendar object.

NumberOfMinutesInThisHour

En lecture seuleGets the number of Minutes in the current Hour.

NumberOfMonthsInThisYear

En lecture seuleGets the number of months in the current year of this Calendar object.

NumberOfPeriodsInThisDay

En lecture seuleGets the number of periods in the current day of this Calendar object.

NumberOfSecondsInThisMinute

En lecture seuleGets the number of Seconds in the current Minute.

NumberOfYearsInThisEra

En lecture seuleGets the number of years in the current era of this Calendar object.

NumeralSystem

Lecture/écritureGets or sets the numbering system that is used when formatting components as strings.

Period

Lecture/écritureGets or sets the period of the current day.

ResolvedLanguage

En lecture seuleGets the language that was most recently used to perform calendar formatting or operations.

Second

Lecture/écritureGets or sets the second.

Year

Lecture/écritureGets or sets the year.

 

Remarques

Si votre application passe les balises de langue utilisées cette classe aux fonctions NLS (National Language Support), elle doit d'abord convertir les balises en appelant ResolveLocaleName.

Conditions requises

Client minimal pris en charge

Windows 8 [Applications Windows Store, applications de bureau]

Serveur minimal pris en charge

Windows Server 2012 [Applications Windows Store, applications de bureau]

Espace de noms

Windows.Globalization
Windows::Globalization [C++]

Métadonnées

Windows.winmd

 

 

Afficher:
© 2015 Microsoft