SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SA::DateTime Struct Reference

Date time structure type. More...

#include <DateTime.hpp>

Public Member Functions

 DateTime ()=default
 Default constructor.
 
 DateTime (uint8_t _second, uint8_t _minute=0u, uint8_t _hour=0u, uint8_t _day=0u, uint8_t _month=0u, uint16_t _year=0u, uint8_t _weekday=0u) noexcept
 
 DateTime (const struct tm &_time) noexcept
 
bool Equals (const DateTime &_other) const noexcept
 Compare two DateTime equality.
 
bool operator== (const DateTime &_rhs) const noexcept
 Compare two DateTime equality.
 
bool operator!= (const DateTime &_rhs) const noexcept
 Compare two DateTime inequality.
 

Static Public Member Functions

static DateTime Now () noexcept
 Get the current local date time.
 
static DateTime GMNow () noexcept
 Get the current date time at Greenwich.
 
static DateTime FileStats (const std::string &_path)
 Query file date time stats at path.
 

Public Attributes

uint8_t second = 0
 second number [0, 59].
 
uint8_t minute = 0
 minute number [0, 59].
 
uint8_t hour = 0
 hour number [0, 23].
 
uint8_t day = 0
 day of the month number [1, 31].
 
uint8_t month = 0
 month number [1, 12].
 
uint16_t year = 0
 Year number.
 
uint8_t weekday = 0
 day number of the week [0, 6].
 

Detailed Description

Date time structure type.

Constructor & Destructor Documentation

◆ DateTime() [1/2]

SA::DateTime::DateTime ( uint8_t _second,
uint8_t _minute = 0u,
uint8_t _hour = 0u,
uint8_t _day = 0u,
uint8_t _month = 0u,
uint16_t _year = 0u,
uint8_t _weekday = 0u )
noexcept

Default Value constructor.

Parameters
[in]_secondsecond values.
[in]_minuteminute values.
[in]_hourhour values.
[in]_dayday values.
[in]_monthmonth values.
[in]_yearyear values.
[in]_weekdayweekday values.

◆ DateTime() [2/2]

SA::DateTime::DateTime ( const struct tm & _time)
noexcept

Value constructor from tm struct.

Parameters
[in]_timetm values.

Member Function Documentation

◆ Equals()

bool SA::DateTime::Equals ( const DateTime & _other) const
noexcept

Compare two DateTime equality.

Parameters
[in]_otherOther date time to compare with.
Returns
Whether this and _other are equal.

◆ FileStats()

static DateTime SA::DateTime::FileStats ( const std::string & _path)
static

Query file date time stats at path.

Parameters
[in]_pathFile path.
Returns
DateTime stats of the file at path.

◆ GMNow()

static DateTime SA::DateTime::GMNow ( )
staticnoexcept

Get the current date time at Greenwich.

Returns
DateTime.

◆ Now()

static DateTime SA::DateTime::Now ( )
staticnoexcept

Get the current local date time.

Returns
DateTime.

◆ operator!=()

bool SA::DateTime::operator!= ( const DateTime & _rhs) const
noexcept

Compare two DateTime inequality.

Parameters
[in]_rhsOther date time to compare with.
Returns
Whether this and _other are not equal.

◆ operator==()

bool SA::DateTime::operator== ( const DateTime & _rhs) const
noexcept

Compare two DateTime equality.

Parameters
[in]_rhsOther date time to compare with.
Returns
Whether this and _other are equal.

The documentation for this struct was generated from the following file: