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

Public Member Functions

 OjaiTime (long epoh)
 Constructor of OjaiTime instance from the milliseconds value since the Unix epoch.The TIME value is set to the corresponding time in the default time zone. More...
 
 OjaiTime (int hourOfDay, int minutes, int seconds)
 Constructor of OjaiTime instance set to the specified hour, minute and seconds. More...
 
 OjaiTime (int hourOfDay, int minutes, int seconds, int ms)
 Constructor of OjaiTime instance set to the specified hour, minute and seconds and milliseconds. More...
 
 OjaiTime (DateTime dateTime)
 Constructor of OjaiTime instance from the specified DateTime. More...
 
DateTime ToDateTime ()
 Returns this OJAI date as DateTime instance. More...
 
int TimeInMillis ()
 The total number of milliseconds since the midnight for this TIME in UTC. More...
 
String ToShortTimeString ()
 A string representation of this TIME in "HH:mm" format. More...
 
String ToFullTimeString ()
 Returns a string representation of this TIME in "HH:mm.ss.SSS" format. More...
 
String ToTimeString ()
 Returns a string representation of this TIME in "HH:mm.ss[.SSS]" format. The milliseconds are omitted if zero. More...
 
String ToString (String pattern)
 Returns a string representation of this TIME using the specified format pattern. More...
 
override String ToString ()
 
override int GetHashCode ()
 
override bool Equals (Object obj)
 

Static Public Member Functions

static OjaiTime Parse (String timeStr)
 Parses and returns an instance of OjaiTime from the specified string. More...
 
static OjaiTime FromMillisOfDay (int millisOfDay)
 Return an OjaiTime instance from the specified milliseconds since midnight. More...
 

Public Attributes

int Hour => _dateTime.Hour
 The hour part of this OJAI date. More...
 
int Minute => _dateTime.Minute
 The minute part of this OJAI date. More...
 
int Second => _dateTime.Second
 The second part of this OJAI date. More...
 
int Millisecond => _dateTime.Millisecond
 The millisecond part of this OJAI date. More...
 

Private Member Functions

 OjaiTime (int millisOfDay)
 Private constructor of OjaiTime instance from the specified milliseconds since midnight. More...
 

Private Attributes

DateTime _dateTime
 
int _millisOfDay
 

Static Private Attributes

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

Constructor & Destructor Documentation

◆ OjaiTime() [1/5]

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

Constructor of OjaiTime instance from the milliseconds value since the Unix epoch.The TIME value is set to the corresponding time in the default time zone.

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

◆ OjaiTime() [2/5]

MapRDB.Driver.Ojai.OjaiTime.OjaiTime ( int  hourOfDay,
int  minutes,
int  seconds 
)

Constructor of OjaiTime instance set to the specified hour, minute and seconds.

Parameters
hourOfDaythe hour of the day, from 0 to 23
minutesthe minute of the hour, from 0 to 59
secondsthe second of the minute, from 0 to 59

◆ OjaiTime() [3/5]

MapRDB.Driver.Ojai.OjaiTime.OjaiTime ( int  hourOfDay,
int  minutes,
int  seconds,
int  ms 
)

Constructor of OjaiTime instance set to the specified hour, minute and seconds and milliseconds.

Parameters
hourOfDaythe hour of the day, from 0 to 23
minutesthe minute of the hour, from 0 to 59
secondsthe second of the minute, from 0 to 59
msthe millisecond of the second, from 0 to 999

◆ OjaiTime() [4/5]

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

Constructor of OjaiTime instance from the specified DateTime.

Parameters
dateTime

◆ OjaiTime() [5/5]

MapRDB.Driver.Ojai.OjaiTime.OjaiTime ( int  millisOfDay)
private

Private constructor of OjaiTime instance from the specified milliseconds since midnight.

Parameters
millisOfDay

Member Function Documentation

◆ FromMillisOfDay()

static OjaiTime MapRDB.Driver.Ojai.OjaiTime.FromMillisOfDay ( int  millisOfDay)
static

Return an OjaiTime instance from the specified milliseconds since midnight.

Parameters
millisOfDaythe number of milliseconds since midnight

◆ Parse()

static OjaiTime MapRDB.Driver.Ojai.OjaiTime.Parse ( String  timeStr)
static

Parses and returns an instance of OjaiTime from the specified string.

Parameters
timeStr

◆ TimeInMillis()

int MapRDB.Driver.Ojai.OjaiTime.TimeInMillis ( )

The total number of milliseconds since the midnight for this TIME in UTC.

◆ ToDateTime()

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

Returns this OJAI date as DateTime instance.

◆ ToFullTimeString()

String MapRDB.Driver.Ojai.OjaiTime.ToFullTimeString ( )

Returns a string representation of this TIME in "HH:mm.ss.SSS" format.

Returns

◆ ToShortTimeString()

String MapRDB.Driver.Ojai.OjaiTime.ToShortTimeString ( )

A string representation of this TIME in "HH:mm" format.

◆ ToString()

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

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

Parameters
pattern

◆ ToTimeString()

String MapRDB.Driver.Ojai.OjaiTime.ToTimeString ( )

Returns a string representation of this TIME in "HH:mm.ss[.SSS]" format. The milliseconds are omitted if zero.

Member Data Documentation

◆ Hour

int MapRDB.Driver.Ojai.OjaiTime.Hour => _dateTime.Hour

The hour part of this OJAI date.

◆ Millisecond

int MapRDB.Driver.Ojai.OjaiTime.Millisecond => _dateTime.Millisecond

The millisecond part of this OJAI date.

◆ Minute

int MapRDB.Driver.Ojai.OjaiTime.Minute => _dateTime.Minute

The minute part of this OJAI date.

◆ Second

int MapRDB.Driver.Ojai.OjaiTime.Second => _dateTime.Second

The second part of this OJAI date.