Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::TimeDate_t Struct Reference

Structure to hold a date and time. More...

Public Member Functions

void Clear (void) noexcept
 Zero out all entries.
 
void GetTime (void) noexcept
 Obtain the current localized time.
 
void TimeToString (char *pOutput) const noexcept
 Convert the time to 23:23:21.
 
void TimeToStringPM (char *pOutput) const noexcept
 Convert the time to 11:23:21PM.
 
void DateToString (char *pOutput) const noexcept
 Convert the date to 10/30/63.
 
void DateToStringVerbose (char *pOutput) const noexcept
 Convert the date to Sunday, October 30, 1963.
 
eError Read (InputMemoryStream *pInput) noexcept
 Read the time from a InputMemoryStream.
 
eError Write (OutputMemoryStream *pOutput) const noexcept
 Write the time into a OutputMemoryStream.
 
int Compare (const TimeDate_t *pInput) const noexcept
 Compares two Burger::TimeDate_t records for equality.
 
uint_t CalcDayOfWeek (void) noexcept
 Given a day, month and year, return the day of the week.
 
eError LoadTimeT (uintptr_t uTimeT) noexcept
 Convert a time_t to a TimeDate_t.
 
eError StoreTimeT (uintptr_t *pTimeT) const noexcept
 Convert a TimeDate_t to a time_t.
 
eError Load (const timespec *pTimeSpec) noexcept
 Convert a timespec to a Burger::TimeDate_t.
 
eError Store (timespec *pTimeSpec) const noexcept
 Convert a Burger::TimeDate_t to a timespec.
 
eError Load (const _SYSTEMTIME *pSystemTime) noexcept
 
eError Store (_SYSTEMTIME *pSystemTime) const noexcept
 
eError Load (const _FILETIME *pFileTime) noexcept
 Convert a Windows FILETIME into a Burger::TimeDate_t.
 
eError Store (_FILETIME *pFileTime) const noexcept
 Convert a Burger::TimeDate_t into a Windows FILETIME.
 
void LoadMSDOS (uint32_t uMSDOSTime) noexcept
 Convert an MSDOS FILETIME into a Burger::TimeDate_t.
 
uint32_t StoreMSDOS (void) const noexcept
 Convert a Burger::TimeDate_t into an MSDOS FILETIME.
 
uint_t Load (const UTCDateTime *pUTCDateTime) noexcept
 Convert a MacOS UTCDateTime into a TimeDate_t.
 
uint_t Store (UTCDateTime *pUTCDateTime) const noexcept
 Convert a TimeDate_t into a MacOS UTCDateTime.
 
void LoadFileSeconds (uint32_t uTime) noexcept
 Convert a Mac HFS time into a TimeDate_t.
 
uint32_t GetFileSeconds (void) const noexcept
 Convert a TimeDate_t into a Mac HFS time.
 
uint_t Load (double dNSTimeInterval) noexcept
 Convert a MacOSX NSTimeInterval into a Burger::TimeDate_t.
 
uint_t Store (double *pNSTimeInterval) const noexcept
 Convert a Burger::TimeDate_t into a MacOSX NSTimeInterval.
 
uint_t Load (const SceDateTime *pSceDateTime) noexcept
 Convert a Playstation Vita SceDateTime into a Burger::TimeDate_t.
 
uint_t Store (SceDateTime *pSceDateTime) const noexcept
 Convert a Burger::TimeDate_t into a SceDateTime.
 

Public Attributes

uint32_t m_uYear
 Year "2009".
 
uint16_t m_usMilliseconds
 0-999
 
uint8_t m_bMonth
 1-12
 
uint8_t m_bDay
 1-31
 
uint8_t m_bDayOfWeek
 0-6
 
uint8_t m_bHour
 0-23
 
uint8_t m_bMinute
 0-59
 
uint8_t m_bSecond
 0-59
 

Friends

uint_t operator== (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is equal to the second.
 
uint_t operator!= (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is not equal to the second.
 
uint_t operator> (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is greater than to the second.
 
uint_t operator>= (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is greater than or equal to the second.
 
uint_t operator< (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is less than to the second.
 
uint_t operator<= (const TimeDate_t &rInput1, const TimeDate_t &rInput2) noexcept
 Return TRUE if the first is less than or equal to the second.
 

Detailed Description

Structure to hold a date and time.


This structure contains all the information of the date and time in a human readable format

Member Function Documentation

◆ CalcDayOfWeek()

uint_t Burger::TimeDate_t::CalcDayOfWeek ( void )
noexcept

Given a day, month and year, return the day of the week.


0 = Sunday, 1 = Monday, 6 = Saturday.

Click here for information on how day was calculated.

Returns
0-6 for the day of the week

◆ Clear()

void Burger::TimeDate_t::Clear ( void )
noexcept

Zero out all entries.


Initialize all entries to zero. This is considered an error state.

◆ Compare()

int Burger::TimeDate_t::Compare ( const TimeDate_t * pInput) const
noexcept

Compares two Burger::TimeDate_t records for equality.


Compares two TimeDate_t records and return -1 if the this is less than the record passed. Return 0 if they are the same and 1 if the parameter is less than the this.

Parameters
pInputPointer to an initialized TimeDate_t record.
Returns
-1 if less then, 0 if equal, 1 if greater than.

◆ DateToString()

void Burger::TimeDate_t::DateToString ( char * pOutput) const
noexcept

Convert the date to 10/30/63.


Convert the date into a string that is in the format of MM/DD/YY

Parameters
pOutputC char buffer at least 9 bytes long to receive the string.
See also
Burger::TimeDate_t::DateToStringVerbose(char *pOutput) const

◆ DateToStringVerbose()

void Burger::TimeDate_t::DateToStringVerbose ( char * pOutput) const
noexcept

Convert the date to Sunday, October 30, 1963.


Convert the date into a string that is in the format of "Sunday, October 30, 1963"

Parameters
pOutputC char buffer at least 64 bytes long to receive the string.
See also
Burger::TimeDate_t::DateToString(char *pOutput) const

◆ GetFileSeconds()

uint32_t Burger::TimeDate_t::GetFileSeconds ( void ) const
noexcept

Convert a TimeDate_t into a Mac HFS time.


Convert the timestamp value to the MacOS file system from a Burgerlib TimeDate_t structure.

Note
This function is only available on MacOS
Returns
Time in seconds from midnight Jan 1st, 1904
See also
LoadFileSeconds(uint32_t) or Store(UTCDateTime *)

◆ GetTime()

void Burger::TimeDate_t::GetTime ( void )
noexcept

Obtain the current localized time.


A query is made to the target platform and the structure is filled in with the current date and time.

◆ Load() [1/6]

Burger::eError Burger::TimeDate_t::Load ( const _FILETIME * pFileTime)
noexcept

Convert a Windows FILETIME into a Burger::TimeDate_t.


Note
This function is only available on the Xbox 360 and Windows
Returns
FALSE if successful, non-zero if not.

◆ Load() [2/6]

eError Burger::TimeDate_t::Load ( const _SYSTEMTIME * pSystemTime)
noexcept

◆ Load() [3/6]

uint_t Burger::TimeDate_t::Load ( const SceDateTime * pSceDateTime)
noexcept

Convert a Playstation Vita SceDateTime into a Burger::TimeDate_t.


Note
This function is only available on Playstation Vita
Returns
FALSE if successful, non-zero if not.

◆ Load() [4/6]

Burger::eError Burger::TimeDate_t::Load ( const timespec * pTimeSpec)
noexcept

Convert a timespec to a Burger::TimeDate_t.


The time is assumed to be GMT and will be converted to local time before stored into the Burger::TimeDate_t structure

Parameters
pTimeSpecA timespec value to retrieve the time from
Returns
Zero if no error, non-zero if the time is invalid

◆ Load() [5/6]

uint_t Burger::TimeDate_t::Load ( const UTCDateTime * pUTCDateTime)
noexcept

Convert a MacOS UTCDateTime into a TimeDate_t.


Note
This function is only available on MacOS and MacOSX
Parameters
pUTCDateTimePointer to a UTCDateTime to convert to a TimeDate_t
Returns
FALSE if successful, non-zero if not.

◆ Load() [6/6]

uint_t Burger::TimeDate_t::Load ( double dNSTimeInterval)
noexcept

Convert a MacOSX NSTimeInterval into a Burger::TimeDate_t.


Note
This function is only available on iOS and MacOSX
Returns
FALSE if successful, non-zero if not.

Note
This function is only available on iOS and MacOSX
Returns
FALSE if successful, non-zero if not.

◆ LoadFileSeconds()

void Burger::TimeDate_t::LoadFileSeconds ( uint32_t uTime)
noexcept

Convert a Mac HFS time into a TimeDate_t.


Convert the timestamp value from the MacOS file system to a Burgerlib TimeDate_t structure.

Note
This function is only available on MacOS
Parameters
uTimeTime in seconds from midnight Jan 1st, 1904
See also
GetFileSeconds(void) const or Load(const UTCDateTime *)

◆ LoadMSDOS()

void Burger::TimeDate_t::LoadMSDOS ( uint32_t uMSDOSTime)
noexcept

Convert an MSDOS FILETIME into a Burger::TimeDate_t.


http://msdn.microsoft.com/en-us/library/windows/desktop/ms724247(v=vs.85).aspx

Note
This is only available on MS/DOS
Parameters
uMSDOSTimeTime/date from an MSDOS file

◆ LoadTimeT()

Burger::eError Burger::TimeDate_t::LoadTimeT ( uintptr_t uTimeT)
noexcept

Convert a time_t to a TimeDate_t.


The time is assumed to be GMT and will be converted to local time before stored into the TimeDate_t structure

Parameters
uTimeTA time_t value obtained by a call to the "C" library.
Returns
The structure is filled with the time as converted from the "C" library time.

◆ Read()

Burger::eError Burger::TimeDate_t::Read ( Burger::InputMemoryStream * pInput)
noexcept

Read the time from a InputMemoryStream.


Read in a stream of 12 bytes and store it into the structure

Parameters
pInputPointer to a valid InputMemoryStream
Returns
kErrorNone if no error, error code on error.
See also
TimeDate_t::Write(OutputMemoryStream *pOutput) const

◆ Store() [1/6]

Burger::eError Burger::TimeDate_t::Store ( _FILETIME * pFileTime) const
noexcept

Convert a Burger::TimeDate_t into a Windows FILETIME.


Note
This function is only available on the Xbox 360 and Windows
Returns
FALSE if successful, non-zero if not.

◆ Store() [2/6]

eError Burger::TimeDate_t::Store ( _SYSTEMTIME * pSystemTime) const
noexcept

◆ Store() [3/6]

uint_t Burger::TimeDate_t::Store ( double * pNSTimeInterval) const
noexcept

Convert a Burger::TimeDate_t into a MacOSX NSTimeInterval.


Note
This function is only available on iOS and MacOSX
Returns
FALSE if successful, non-zero if not.

Note
This function is only available on iOS and MacOSX
Returns
FALSE if successful, non-zero if not.

◆ Store() [4/6]

uint_t Burger::TimeDate_t::Store ( SceDateTime * pSceDateTime) const
noexcept

Convert a Burger::TimeDate_t into a SceDateTime.


Note
This function is only available on Playstation Vita
Returns
FALSE if successful, non-zero if not.

◆ Store() [5/6]

Burger::eError Burger::TimeDate_t::Store ( timespec * pTimeSpec) const
noexcept

Convert a Burger::TimeDate_t to a timespec.


The time is assumed to be local and will be converted to GMT before stored into the timespec structure

Parameters
pTimeSpecA timespec value to receive the time
Returns
Zero if no error, non-zero if the time is invalid

◆ Store() [6/6]

uint_t Burger::TimeDate_t::Store ( UTCDateTime * pUTCDateTime) const
noexcept

Convert a TimeDate_t into a MacOS UTCDateTime.


Note
This function is only available on MacOS and MacOSX
Parameters
pUTCDateTimePointer to a UTCDateTime structure to fill in with the time/date
Returns
FALSE if successful, non-zero if not.

◆ StoreMSDOS()

uint32_t Burger::TimeDate_t::StoreMSDOS ( void ) const
noexcept

Convert a Burger::TimeDate_t into an MSDOS FILETIME.


http://msdn.microsoft.com/en-us/library/windows/desktop/ms724247(v=vs.85).aspx

Note
This is only available on MS/DOS
Returns
MSDOS FILETIME

◆ StoreTimeT()

Burger::eError Burger::TimeDate_t::StoreTimeT ( uintptr_t * pTimeT) const
noexcept

Convert a TimeDate_t to a time_t.


The time is assumed to be local and will be converted to GMT time before stored into the time_t value

Parameters
pTimeTA time_t value to receive the new time
Returns
The structure is filled with the time as converted from the "C" library time.

◆ TimeToString()

void Burger::TimeDate_t::TimeToString ( char * pOutput) const
noexcept

Convert the time to 23:23:21.


Convert the time into a string that is in the format of HH:MM:SS. Uses a 24 hour (Military time) format.

Parameters
pOutputC char buffer at least 9 bytes long to receive the string.
See also
Burger::TimeDate_t::TimeToStringPM(char *pOutput) const

◆ TimeToStringPM()

void Burger::TimeDate_t::TimeToStringPM ( char * pOutput) const
noexcept

Convert the time to 11:23:21PM.


Convert the time into a string that is in the format of HH:MM:SSAM Uses a 12 hour (AM/PM) format.

Parameters
pOutputC char buffer at least 11 bytes long to receive the string.
See also
Burger::TimeDate_t::TimeToString(char *pOutput) const

◆ Write()

Burger::eError Burger::TimeDate_t::Write ( Burger::OutputMemoryStream * pOutput) const
noexcept

Write the time into a OutputMemoryStream.


Write 12 bytes into the stream to record the time

Parameters
pOutputPointer to a valid OutputMemoryStream
Returns
kErrorNone if no error, error code on error.
See also
TimeDate_t::Read(InputMemoryStream *pOutput)

Friends And Related Symbol Documentation

◆ operator!=

uint_t operator!= ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is not equal to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is not equal to the second

◆ operator<

uint_t operator< ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is less than to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is less than to the second

◆ operator<=

uint_t operator<= ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is less than or equal to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is less than or equal to the second

◆ operator==

uint_t operator== ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is equal to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is equal to the second

◆ operator>

uint_t operator> ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is greater than to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is greater than to the second

◆ operator>=

uint_t operator>= ( const TimeDate_t & rInput1,
const TimeDate_t & rInput2 )
friend

Return TRUE if the first is greater than or equal to the second.


Parameters
rInput1Burger::TimeDate_t to test
rInput2Burger::TimeDate_t to test against
Returns
TRUE if the first is greater than or equal to the second

Member Data Documentation

◆ m_bDay

uint8_t Burger::TimeDate_t::m_bDay

1-31

◆ m_bDayOfWeek

uint8_t Burger::TimeDate_t::m_bDayOfWeek

0-6

◆ m_bHour

uint8_t Burger::TimeDate_t::m_bHour

0-23

◆ m_bMinute

uint8_t Burger::TimeDate_t::m_bMinute

0-59

◆ m_bMonth

uint8_t Burger::TimeDate_t::m_bMonth

1-12

◆ m_bSecond

uint8_t Burger::TimeDate_t::m_bSecond

0-59

◆ m_usMilliseconds

uint16_t Burger::TimeDate_t::m_usMilliseconds

0-999

◆ m_uYear

uint32_t Burger::TimeDate_t::m_uYear

Year "2009".