rcolyer.net
RC Lib  Version 202403231100
Public Member Functions | List of all members
RC::TimeOfDay Class Reference

A class which obeys periodic time-of-day boundaries, and can manage times being within a daily time frame. More...

#include <RTime.h>

Public Member Functions

 TimeOfDay ()
 Default constructor, initializes to local time.
 
 TimeOfDay (struct tm tmval)
 Initializes to tmval.
 
 TimeOfDay (u32 hr, u32 min=0, u32 sec=0)
 Initializes to the given hr, min, sec from midnight.
 
TimeOfDayoperator= (struct tm tmval)
 Initializes to tmval.
 
TimeOfDayoperator-= (const TimeOfDay &other)
 Subtracts another TimeOfDay amount, obeying periodic boundaries.
 
TimeOfDay operator- (const TimeOfDay &other) const
 Subtracts two TimeOfDay amounts, obeying periodic boundaries.
 
TimeOfDayoperator+= (const TimeOfDay &other)
 Adds another TimeOfDay amount, obeying periodic boundaries.
 
TimeOfDay operator+ (const TimeOfDay &other) const
 Adds two TimeOfDay amounts, obeying periodic boundaries.
 
bool operator< (const TimeOfDay &other) const
 True if this TimeOfDay is < the other.
 
bool operator<= (const TimeOfDay &other) const
 True if this TimeOfDay is <= the other.
 
bool operator> (const TimeOfDay &other) const
 True if this TimeOfDay is > the other.
 
bool operator>= (const TimeOfDay &other) const
 True if this TimeOfDay is >= the other.
 
bool operator== (const TimeOfDay &other) const
 True if this TimeOfDay is == the other.
 
bool Between (const TimeOfDay &left, const TimeOfDay &right) const
 True if this TimeOfDay is later than left and earlier than right, obeying periodic boundaries.
 
u32 Hr () const
 Returns the 0-23 hour value after midnight.
 
u32 Min () const
 Returns the 0-59 minute value after midnight.
 
u32 Sec () const
 Returns the 0-59 second value after midnight.
 
u32 AsSeconds () const
 Returns the total seconds after midnight.
 
u32 AsMinutes () const
 Returns the total minutes after midnight.
 
u32 AsHours () const
 Returns the total hours after midnight.
 
RStr ToString (bool AmPm=false) const
 Returns a formatted string representation.
 
void FromSeconds (u32 newsec)
 Initializes from a number of seconds after midnight.
 
void FromMinutes (u32 newmin)
 Initializes from a number of minutes after midnight.
 

Detailed Description

A class which obeys periodic time-of-day boundaries, and can manage times being within a daily time frame.


The documentation for this class was generated from the following file:
email address
— (c) 2015