Time

Enumerations

enum  DayOfWeek {
  Monday,
  Tuesday,
  Wednesday,
  Thursday,
  Friday,
  Saturday,
  Sunday
}
 

Functions

Int32 CompareDateTime (const DateTime &a, const DateTime &b)
 
Float64 GetJulianDay (const DateTime &t)
 
DateTime FromJulianDay (Float64 j)
 
void GetDateTimeNow (DateTime &t)
 
void GetDateTimeNowGMT (DateTime &t)
 
Bool LocalToGMTime (const DateTime &tLocal, DateTime &tGMT)
 
Bool GMTimeToLocal (const DateTime &tGMT, DateTime &tLocal)
 
DayOfWeek GetDayOfWeek (Int32 lYear, Int32 lMonth, Int32 lDay)
 
String FormatTime (const char *pszFormat, const DateTime &t)
 

Detailed Description

Enumeration Type Documentation

◆ DayOfWeek

enum DayOfWeek

Week days.

Enumerator
Monday 
Tuesday 
Wednesday 
Thursday 
Friday 
Saturday 
Sunday 

Function Documentation

◆ CompareDateTime()

Int32 cineware::CompareDateTime ( const DateTime a,
const DateTime b 
)

Compare date times a and b.

Parameters
[in]aA date time.
[in]bB date time.
Returns
Less than 0 if a < b, equal to 0 if a == b and greater than 0 if a > b.

◆ GetJulianDay()

Float64 cineware::GetJulianDay ( const DateTime t)

Gets the Modified Julian Date (http://tycho.usno.navy.mil/mjd.html) from t.

Parameters
[in]tA date time.
Returns
The Modified Julian Date. To get the correct Julian day, take the integer of this value and subtract 0.5

◆ FromJulianDay()

DateTime cineware::FromJulianDay ( Float64  j)

Gets a date time from the Modified Julian Date (http://tycho.usno.navy.mil/mjd.html) j.

Parameters
[in]jA Modified Julian Date.
Returns
The date time.

◆ GetDateTimeNow()

void cineware::GetDateTimeNow ( DateTime t)

Gets the current system date time.

Parameters
[out]tFilled with the current system time.

◆ GetDateTimeNowGMT()

void cineware::GetDateTimeNowGMT ( DateTime t)

Gets the current system date time in GMT.

Parameters
[out]tFilled with the current system GMT time.

◆ LocalToGMTime()

Bool cineware::LocalToGMTime ( const DateTime tLocal,
DateTime tGMT 
)

Converts local time to GMT depending on the OS time zone settings.

Warning
The function will fail if the local date is before Jan 1, 1970 2.01 am or after Jan 18, 2038 7 pm.
Parameters
[in]tLocalThe local time.
[out]tGMTFilled with the calculated GMT time, or tLocal if an error occurred.
Returns
true if successful, otherwise false.

◆ GMTimeToLocal()

Bool cineware::GMTimeToLocal ( const DateTime tGMT,
DateTime tLocal 
)

Converts GMT time to local depending on the OS time zone settings.

Parameters
[in]tGMTThe GMT time.
[out]tLocalFilled with the calculated local time, or tGMT if an error occurred.
Returns
true if successful, otherwise false.

◆ GetDayOfWeek()

DayOfWeek cineware::GetDayOfWeek ( Int32  lYear,
Int32  lMonth,
Int32  lDay 
)

Gets the day of the week of the date lYear-lMonth-lDay.

Parameters
[in]lYearThe year.
[in]lMonthThe month number. (1 means January.)
[in]lDayThe day in the month.
Returns
The day of the week.

◆ FormatTime()

String cineware::FormatTime ( const char *  pszFormat,
const DateTime t 
)

Formats the given date time t and output it as a string.

Parameters
[in]pszFormatThe format options (same as asctime() format).
[in]tThe date time to format.
Returns
The formatted string for the date time.