System::Globalization::Details::GregorianCalendarUtils Class Referencefinal

Gregorian calendar utility functions. More...

Static Public Member Functions

static int GetDaysInYear (int year)
 
static int GetDaysInMonth (int year, int month)
 
static bool IsLeapYear (int year)
 
static bool IsLeapDay (int year, int month, int day)
 
static std::unique_ptr< codeporting_icu::Calendar > CreateCalendar ()
 
static codeporting_icu::Calendar & GetCalendar ()
 
static double ConvertDateTimeToUDate (DateTime time)
 Convert DateTime to ICU UDate. More...
 
static DateTime ConvertUDateToDateTime (const double time)
 Convert ICU UDate to DateTime. More...
 

Static Public Attributes

static constexpr int MinYear = 1
 Min supported Gregorian year. More...
 
static constexpr int MaxYear = 9999
 Max supported Gregorian year. More...
 

Detailed Description

Gregorian calendar utility functions.

Member Function Documentation

◆ ConvertDateTimeToUDate()

static double System::Globalization::Details::GregorianCalendarUtils::ConvertDateTimeToUDate ( DateTime  time)
static

Convert DateTime to ICU UDate.

◆ ConvertUDateToDateTime()

static DateTime System::Globalization::Details::GregorianCalendarUtils::ConvertUDateToDateTime ( const double  time)
static

Convert ICU UDate to DateTime.

◆ CreateCalendar()

static std::unique_ptr<codeporting_icu::Calendar> System::Globalization::Details::GregorianCalendarUtils::CreateCalendar ( )
static

Create gregorian ICU calendar.

Returns
ICU calendar.

◆ GetCalendar()

static codeporting_icu::Calendar& System::Globalization::Details::GregorianCalendarUtils::GetCalendar ( )
static

Gets thread-local gregorian ICU calendar.

Returns
ICU calendar.

◆ GetDaysInMonth()

static int System::Globalization::Details::GregorianCalendarUtils::GetDaysInMonth ( int  year,
int  month 
)
static

Gets number of days in specific month.

Parameters
yearYear.
monthMonth.
Returns
Number of days in specified month of specified year.

◆ GetDaysInYear()

static int System::Globalization::Details::GregorianCalendarUtils::GetDaysInYear ( int  year)
static

Gets number of days in specific year.

Parameters
yearYear.
Returns
Number of days in specified year.

◆ IsLeapDay()

static bool System::Globalization::Details::GregorianCalendarUtils::IsLeapDay ( int  year,
int  month,
int  day 
)
static

Checks if the day is leap.

Parameters
yearYear.
monthMonth.
dayDay.
Returns
True if specified date is leap, false otherwise.

◆ IsLeapYear()

static bool System::Globalization::Details::GregorianCalendarUtils::IsLeapYear ( int  year)
static

Checks if the year is leap.

Parameters
yearYear.
Returns
True if specified year is leap, false otherwise.

Member Data Documentation

◆ MaxYear

constexpr int System::Globalization::Details::GregorianCalendarUtils::MaxYear = 9999
static

Max supported Gregorian year.

◆ MinYear

constexpr int System::Globalization::Details::GregorianCalendarUtils::MinYear = 1
static

Min supported Gregorian year.