Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CDateTime Class Referencefinal

DateTime class, which uses FileTime as it's base. More...

#include <XBDateTime.h>

Inheritance diagram for CDateTime:
IArchivable

Public Types

enum class  ReturnFormat : bool { CHOICE_YES = true , CHOICE_NO = false }
 

Public Member Functions

 CDateTime ()
 
 CDateTime (const CDateTime &time)
 
CDateTimeoperator= (const CDateTime &)=default
 
 CDateTime (const KODI::TIME::SystemTime &time)
 
 CDateTime (const KODI::TIME::FileTime &time)
 
 CDateTime (const time_t &time)
 
 CDateTime (const tm &time)
 
 CDateTime (int year, int month, int day, int hour, int minute, int second)
 
const CDateTimeoperator= (const KODI::TIME::SystemTime &right)
 
const CDateTimeoperator= (const KODI::TIME::FileTime &right)
 
const CDateTimeoperator= (const time_t &right)
 
const CDateTimeoperator= (const tm &right)
 
bool operator> (const CDateTime &right) const
 
bool operator>= (const CDateTime &right) const
 
bool operator< (const CDateTime &right) const
 
bool operator<= (const CDateTime &right) const
 
bool operator== (const CDateTime &right) const
 
bool operator!= (const CDateTime &right) const
 
bool operator> (const KODI::TIME::FileTime &right) const
 
bool operator>= (const KODI::TIME::FileTime &right) const
 
bool operator< (const KODI::TIME::FileTime &right) const
 
bool operator<= (const KODI::TIME::FileTime &right) const
 
bool operator== (const KODI::TIME::FileTime &right) const
 
bool operator!= (const KODI::TIME::FileTime &right) const
 
bool operator> (const KODI::TIME::SystemTime &right) const
 
bool operator>= (const KODI::TIME::SystemTime &right) const
 
bool operator< (const KODI::TIME::SystemTime &right) const
 
bool operator<= (const KODI::TIME::SystemTime &right) const
 
bool operator== (const KODI::TIME::SystemTime &right) const
 
bool operator!= (const KODI::TIME::SystemTime &right) const
 
bool operator> (const time_t &right) const
 
bool operator>= (const time_t &right) const
 
bool operator< (const time_t &right) const
 
bool operator<= (const time_t &right) const
 
bool operator== (const time_t &right) const
 
bool operator!= (const time_t &right) const
 
bool operator> (const tm &right) const
 
bool operator>= (const tm &right) const
 
bool operator< (const tm &right) const
 
bool operator<= (const tm &right) const
 
bool operator== (const tm &right) const
 
bool operator!= (const tm &right) const
 
CDateTime operator+ (const CDateTimeSpan &right) const
 
CDateTime operator- (const CDateTimeSpan &right) const
 
const CDateTimeoperator+= (const CDateTimeSpan &right)
 
const CDateTimeoperator-= (const CDateTimeSpan &right)
 
CDateTimeSpan operator- (const CDateTime &right) const
 
 operator KODI::TIME::FileTime () const
 
void Archive (CArchive &ar) override
 
void Reset ()
 
int GetDay () const
 
int GetMonth () const
 
int GetYear () const
 
int GetHour () const
 
int GetMinute () const
 
int GetSecond () const
 
int GetDayOfWeek () const
 
int GetMinuteOfDay () const
 
bool SetDateTime (int year, int month, int day, int hour, int minute, int second)
 
bool SetDate (int year, int month, int day)
 
bool SetTime (int hour, int minute, int second)
 
bool SetFromDateString (const std::string &date)
 
bool SetFromDBDate (const std::string &date)
 
bool SetFromDBTime (const std::string &time)
 
bool SetFromW3CDate (const std::string &date)
 
bool SetFromW3CDateTime (const std::string &date, bool ignoreTimezone=false)
 
bool SetFromUTCDateTime (const CDateTime &dateTime)
 
bool SetFromUTCDateTime (const time_t &dateTime)
 
bool SetFromRFC1123DateTime (const std::string &dateTime)
 
bool SetFromDBDateTime (const std::string &dateTime)
 set from a database datetime format YYYY-MM-DD HH:MM:SS
 
void GetAsSystemTime (KODI::TIME::SystemTime &time) const
 
void GetAsTime (time_t &time) const
 
void GetAsTm (tm &time) const
 
void GetAsTimeStamp (KODI::TIME::FileTime &time) const
 
CDateTime GetAsUTCDateTime () const
 
std::string GetAsSaveString () const
 
std::string GetAsDBDateTime () const
 
std::string GetAsDBDate () const
 
std::string GetAsDBTime () const
 
std::string GetAsLocalizedDate (bool longDate=false) const
 
std::string GetAsLocalizedDate (const std::string &strFormat) const
 
std::string GetAsLocalizedDate (const std::string &strFormat, ReturnFormat returnFormat) const
 
std::string GetAsLocalizedTime (const std::string &format, bool withSeconds=true) const
 
std::string GetAsLocalizedDateTime (bool longDate=false, bool withSeconds=true) const
 
std::string GetAsLocalizedTime (TIME_FORMAT format, bool withSeconds=false) const
 
std::string GetAsRFC1123DateTime () const
 
std::string GetAsW3CDate () const
 
std::string GetAsW3CDateTime (bool asUtc=false) const
 
void SetValid (bool yesNo)
 
bool IsValid () const
 
- Public Member Functions inherited from IArchivable

Static Public Member Functions

static CDateTime GetCurrentDateTime ()
 
static CDateTime GetUTCDateTime ()
 
static int MonthStringToMonthNum (const std::string &month)
 
static CDateTime FromDBDateTime (const std::string &dateTime)
 
static CDateTime FromDateString (const std::string &date)
 
static CDateTime FromDBDate (const std::string &date)
 
static CDateTime FromDBTime (const std::string &time)
 
static CDateTime FromW3CDate (const std::string &date)
 
static CDateTime FromW3CDateTime (const std::string &date, bool ignoreTimezone=false)
 
static CDateTime FromUTCDateTime (const CDateTime &dateTime)
 
static CDateTime FromUTCDateTime (const time_t &dateTime)
 
static CDateTime FromRFC1123DateTime (const std::string &dateTime)
 
static void ResetTimezoneBias (void)
 
static CDateTimeSpan GetTimezoneBias (void)
 

Additional Inherited Members

- Protected Member Functions inherited from IArchivable
virtual ~IArchivable ()=default
 

Detailed Description

DateTime class, which uses FileTime as it's base.

Member Enumeration Documentation

◆ ReturnFormat

enum class CDateTime::ReturnFormat : bool
strong
Enumerator
CHOICE_YES 
CHOICE_NO 

Constructor & Destructor Documentation

◆ CDateTime() [1/7]

CDateTime::CDateTime ( )

◆ CDateTime() [2/7]

CDateTime::CDateTime ( const CDateTime & time)

◆ CDateTime() [3/7]

CDateTime::CDateTime ( const KODI::TIME::SystemTime & time)
explicit

◆ CDateTime() [4/7]

CDateTime::CDateTime ( const KODI::TIME::FileTime & time)
explicit

◆ CDateTime() [5/7]

CDateTime::CDateTime ( const time_t & time)
explicit

◆ CDateTime() [6/7]

CDateTime::CDateTime ( const tm & time)
explicit

◆ CDateTime() [7/7]

CDateTime::CDateTime ( int year,
int month,
int day,
int hour,
int minute,
int second )

Member Function Documentation

◆ Archive()

void CDateTime::Archive ( CArchive & ar)
overridevirtual

Implements IArchivable.

◆ FromDateString()

CDateTime CDateTime::FromDateString ( const std::string & date)
static

◆ FromDBDate()

CDateTime CDateTime::FromDBDate ( const std::string & date)
static

◆ FromDBDateTime()

CDateTime CDateTime::FromDBDateTime ( const std::string & dateTime)
static

◆ FromDBTime()

CDateTime CDateTime::FromDBTime ( const std::string & time)
static

◆ FromRFC1123DateTime()

CDateTime CDateTime::FromRFC1123DateTime ( const std::string & dateTime)
static

◆ FromUTCDateTime() [1/2]

CDateTime CDateTime::FromUTCDateTime ( const CDateTime & dateTime)
static

◆ FromUTCDateTime() [2/2]

CDateTime CDateTime::FromUTCDateTime ( const time_t & dateTime)
static

◆ FromW3CDate()

CDateTime CDateTime::FromW3CDate ( const std::string & date)
static

◆ FromW3CDateTime()

CDateTime CDateTime::FromW3CDateTime ( const std::string & date,
bool ignoreTimezone = false )
static

◆ GetAsDBDate()

std::string CDateTime::GetAsDBDate ( ) const

◆ GetAsDBDateTime()

std::string CDateTime::GetAsDBDateTime ( ) const

◆ GetAsDBTime()

std::string CDateTime::GetAsDBTime ( ) const

◆ GetAsLocalizedDate() [1/3]

std::string CDateTime::GetAsLocalizedDate ( bool longDate = false) const

◆ GetAsLocalizedDate() [2/3]

std::string CDateTime::GetAsLocalizedDate ( const std::string & strFormat) const

◆ GetAsLocalizedDate() [3/3]

std::string CDateTime::GetAsLocalizedDate ( const std::string & strFormat,
ReturnFormat returnFormat ) const

◆ GetAsLocalizedDateTime()

std::string CDateTime::GetAsLocalizedDateTime ( bool longDate = false,
bool withSeconds = true ) const

◆ GetAsLocalizedTime() [1/2]

std::string CDateTime::GetAsLocalizedTime ( const std::string & format,
bool withSeconds = true ) const

◆ GetAsLocalizedTime() [2/2]

std::string CDateTime::GetAsLocalizedTime ( TIME_FORMAT format,
bool withSeconds = false ) const

◆ GetAsRFC1123DateTime()

std::string CDateTime::GetAsRFC1123DateTime ( ) const

◆ GetAsSaveString()

std::string CDateTime::GetAsSaveString ( ) const

◆ GetAsSystemTime()

void CDateTime::GetAsSystemTime ( KODI::TIME::SystemTime & time) const

◆ GetAsTime()

void CDateTime::GetAsTime ( time_t & time) const

◆ GetAsTimeStamp()

void CDateTime::GetAsTimeStamp ( KODI::TIME::FileTime & time) const

◆ GetAsTm()

void CDateTime::GetAsTm ( tm & time) const

◆ GetAsUTCDateTime()

CDateTime CDateTime::GetAsUTCDateTime ( ) const

◆ GetAsW3CDate()

std::string CDateTime::GetAsW3CDate ( ) const

◆ GetAsW3CDateTime()

std::string CDateTime::GetAsW3CDateTime ( bool asUtc = false) const

◆ GetCurrentDateTime()

CDateTime CDateTime::GetCurrentDateTime ( )
static

◆ GetDay()

int CDateTime::GetDay ( ) const

◆ GetDayOfWeek()

int CDateTime::GetDayOfWeek ( ) const

◆ GetHour()

int CDateTime::GetHour ( ) const

◆ GetMinute()

int CDateTime::GetMinute ( ) const

◆ GetMinuteOfDay()

int CDateTime::GetMinuteOfDay ( ) const

◆ GetMonth()

int CDateTime::GetMonth ( ) const

◆ GetSecond()

int CDateTime::GetSecond ( ) const

◆ GetTimezoneBias()

CDateTimeSpan CDateTime::GetTimezoneBias ( void )
static

◆ GetUTCDateTime()

CDateTime CDateTime::GetUTCDateTime ( )
static

◆ GetYear()

int CDateTime::GetYear ( ) const

◆ IsValid()

bool CDateTime::IsValid ( ) const

◆ MonthStringToMonthNum()

int CDateTime::MonthStringToMonthNum ( const std::string & month)
static

◆ operator KODI::TIME::FileTime()

CDateTime::operator KODI::TIME::FileTime ( ) const

◆ operator!=() [1/5]

bool CDateTime::operator!= ( const CDateTime & right) const

◆ operator!=() [2/5]

bool CDateTime::operator!= ( const KODI::TIME::FileTime & right) const

◆ operator!=() [3/5]

bool CDateTime::operator!= ( const KODI::TIME::SystemTime & right) const

◆ operator!=() [4/5]

bool CDateTime::operator!= ( const time_t & right) const

◆ operator!=() [5/5]

bool CDateTime::operator!= ( const tm & right) const

◆ operator+()

CDateTime CDateTime::operator+ ( const CDateTimeSpan & right) const

◆ operator+=()

const CDateTime & CDateTime::operator+= ( const CDateTimeSpan & right)

◆ operator-() [1/2]

CDateTimeSpan CDateTime::operator- ( const CDateTime & right) const

◆ operator-() [2/2]

CDateTime CDateTime::operator- ( const CDateTimeSpan & right) const

◆ operator-=()

const CDateTime & CDateTime::operator-= ( const CDateTimeSpan & right)

◆ operator<() [1/5]

bool CDateTime::operator< ( const CDateTime & right) const

◆ operator<() [2/5]

bool CDateTime::operator< ( const KODI::TIME::FileTime & right) const

◆ operator<() [3/5]

bool CDateTime::operator< ( const KODI::TIME::SystemTime & right) const

◆ operator<() [4/5]

bool CDateTime::operator< ( const time_t & right) const

◆ operator<() [5/5]

bool CDateTime::operator< ( const tm & right) const

◆ operator<=() [1/5]

bool CDateTime::operator<= ( const CDateTime & right) const

◆ operator<=() [2/5]

bool CDateTime::operator<= ( const KODI::TIME::FileTime & right) const

◆ operator<=() [3/5]

bool CDateTime::operator<= ( const KODI::TIME::SystemTime & right) const

◆ operator<=() [4/5]

bool CDateTime::operator<= ( const time_t & right) const

◆ operator<=() [5/5]

bool CDateTime::operator<= ( const tm & right) const

◆ operator=() [1/5]

CDateTime & CDateTime::operator= ( const CDateTime & )
default

◆ operator=() [2/5]

const CDateTime & CDateTime::operator= ( const KODI::TIME::FileTime & right)

◆ operator=() [3/5]

const CDateTime & CDateTime::operator= ( const KODI::TIME::SystemTime & right)

◆ operator=() [4/5]

const CDateTime & CDateTime::operator= ( const time_t & right)

◆ operator=() [5/5]

const CDateTime & CDateTime::operator= ( const tm & right)

◆ operator==() [1/5]

bool CDateTime::operator== ( const CDateTime & right) const

◆ operator==() [2/5]

bool CDateTime::operator== ( const KODI::TIME::FileTime & right) const

◆ operator==() [3/5]

bool CDateTime::operator== ( const KODI::TIME::SystemTime & right) const

◆ operator==() [4/5]

bool CDateTime::operator== ( const time_t & right) const

◆ operator==() [5/5]

bool CDateTime::operator== ( const tm & right) const

◆ operator>() [1/5]

bool CDateTime::operator> ( const CDateTime & right) const

◆ operator>() [2/5]

bool CDateTime::operator> ( const KODI::TIME::FileTime & right) const

◆ operator>() [3/5]

bool CDateTime::operator> ( const KODI::TIME::SystemTime & right) const

◆ operator>() [4/5]

bool CDateTime::operator> ( const time_t & right) const

◆ operator>() [5/5]

bool CDateTime::operator> ( const tm & right) const

◆ operator>=() [1/5]

bool CDateTime::operator>= ( const CDateTime & right) const

◆ operator>=() [2/5]

bool CDateTime::operator>= ( const KODI::TIME::FileTime & right) const

◆ operator>=() [3/5]

bool CDateTime::operator>= ( const KODI::TIME::SystemTime & right) const

◆ operator>=() [4/5]

bool CDateTime::operator>= ( const time_t & right) const

◆ operator>=() [5/5]

bool CDateTime::operator>= ( const tm & right) const

◆ Reset()

void CDateTime::Reset ( )

◆ ResetTimezoneBias()

void CDateTime::ResetTimezoneBias ( void )
static

◆ SetDate()

bool CDateTime::SetDate ( int year,
int month,
int day )

◆ SetDateTime()

bool CDateTime::SetDateTime ( int year,
int month,
int day,
int hour,
int minute,
int second )

◆ SetFromDateString()

bool CDateTime::SetFromDateString ( const std::string & date)
Todo
STRING_CLEANUP

◆ SetFromDBDate()

bool CDateTime::SetFromDBDate ( const std::string & date)

◆ SetFromDBDateTime()

bool CDateTime::SetFromDBDateTime ( const std::string & dateTime)

set from a database datetime format YYYY-MM-DD HH:MM:SS

See also
GetAsDBDateTime()

◆ SetFromDBTime()

bool CDateTime::SetFromDBTime ( const std::string & time)

◆ SetFromRFC1123DateTime()

bool CDateTime::SetFromRFC1123DateTime ( const std::string & dateTime)

◆ SetFromUTCDateTime() [1/2]

bool CDateTime::SetFromUTCDateTime ( const CDateTime & dateTime)

◆ SetFromUTCDateTime() [2/2]

bool CDateTime::SetFromUTCDateTime ( const time_t & dateTime)

◆ SetFromW3CDate()

bool CDateTime::SetFromW3CDate ( const std::string & date)

◆ SetFromW3CDateTime()

bool CDateTime::SetFromW3CDateTime ( const std::string & date,
bool ignoreTimezone = false )

◆ SetTime()

bool CDateTime::SetTime ( int hour,
int minute,
int second )

◆ SetValid()

void CDateTime::SetValid ( bool yesNo)

The documentation for this class was generated from the following files: