C# OJAI Client API
MapRDB.Driver.Ojai.OjaiDate Class Reference

Public Member Functions

 OjaiDate (int year, int month, int dayOfMonth)
 Constructor of OjaiDate instance from the specified year, month and day of the month More...
 
 OjaiDate (long epoh)
 Constructor of OjaiDate instance from the milliseconds value since the Unix epoch. The DATE value is set to the calendar date in the default time zone. More...
 
 OjaiDate (DateTime dateTime)
 Constructor of OjaiDate instance from the specified DateTime. More...
 
DateTime ToDateTime ()
 Return this OJAI date as DateTime instance. More...
 
String ToDateString ()
 Returns a string representation of this OJAI date in ISO8601 format (yyyy-MM-dd). More...
 
String ToString (String pattern)
 Returns a string representation of this OJAI date using the specified format pattern. More...
 
override String ToString ()
 
override int GetHashCode ()
 
override bool Equals (Object obj)
 

Static Public Member Functions

static OjaiDate Parse (String dateStr)
 Parse and return an instance of OjaiDate from the specified string. More...
 
static OjaiDate FromDaysSinceEpoch (int daysSinceEpoch)
 Return an OajiDate instance from the specified number of days since epoch. More...
 

Public Attributes

int Year => _dateTime.Year
 Number of years of OJAI Date. More...
 
int Month => _dateTime.Month
 Number of months of OJAI Date. More...
 
int Day => _dateTime.Day
 Number of days of month of OJAI Date. More...
 
int DaysSinceEpoch => _daysSinceEpoch
 The total number of days since the Unix epoch. More...
 

Private Member Functions

 OjaiDate (int daysSinceEpoch)
 Private constructor of OjaiDate instance from the specified number of days since epoch. More...
 

Private Attributes

DateTime _dateTime
 
int _daysSinceEpoch
 

Static Private Attributes

static DateTime EPOCH_DATE = new DateTime(1970, 1, 1)
 

Constructor & Destructor Documentation

◆ OjaiDate() [1/4]

MapRDB.Driver.Ojai.OjaiDate.OjaiDate ( int  year,
int  month,
int  dayOfMonth 
)

Constructor of OjaiDate instance from the specified year, month and day of the month

Parameters
yearthe year
monththe month of the year, from 1 to 12
dayOfMonththe day of the month, from 1 to 31

◆ OjaiDate() [2/4]

MapRDB.Driver.Ojai.OjaiDate.OjaiDate ( long  epoh)

Constructor of OjaiDate instance from the milliseconds value since the Unix epoch. The DATE value is set to the calendar date in the default time zone.

Parameters
epohthe milliseconds from 1970-01-01T00:00:00.000 UTC

◆ OjaiDate() [3/4]

MapRDB.Driver.Ojai.OjaiDate.OjaiDate ( DateTime  dateTime)

Constructor of OjaiDate instance from the specified DateTime.

Parameters
dateTime

◆ OjaiDate() [4/4]

MapRDB.Driver.Ojai.OjaiDate.OjaiDate ( int  daysSinceEpoch)
private

Private constructor of OjaiDate instance from the specified number of days since epoch.

Parameters
daysSinceEpoch

Member Function Documentation

◆ FromDaysSinceEpoch()

static OjaiDate MapRDB.Driver.Ojai.OjaiDate.FromDaysSinceEpoch ( int  daysSinceEpoch)
static

Return an OajiDate instance from the specified number of days since epoch.

Parameters
daysSinceEpochthe number of days since epoch

◆ Parse()

static OjaiDate MapRDB.Driver.Ojai.OjaiDate.Parse ( String  dateStr)
static

Parse and return an instance of OjaiDate from the specified string.

Parameters
dateStr
Returns

◆ ToDateString()

String MapRDB.Driver.Ojai.OjaiDate.ToDateString ( )

Returns a string representation of this OJAI date in ISO8601 format (yyyy-MM-dd).

◆ ToDateTime()

DateTime MapRDB.Driver.Ojai.OjaiDate.ToDateTime ( )

Return this OJAI date as DateTime instance.

◆ ToString()

String MapRDB.Driver.Ojai.OjaiDate.ToString ( String  pattern)

Returns a string representation of this OJAI date using the specified format pattern.

Parameters
pattern

Member Data Documentation

◆ Day

int MapRDB.Driver.Ojai.OjaiDate.Day => _dateTime.Day

Number of days of month of OJAI Date.

◆ DaysSinceEpoch

int MapRDB.Driver.Ojai.OjaiDate.DaysSinceEpoch => _daysSinceEpoch

The total number of days since the Unix epoch.

◆ Month

int MapRDB.Driver.Ojai.OjaiDate.Month => _dateTime.Month

Number of months of OJAI Date.

◆ Year

int MapRDB.Driver.Ojai.OjaiDate.Year => _dateTime.Year

Number of years of OJAI Date.