Rose
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DateTime Class Reference

Encapsulate the day-in-space for orbital mechanics computations. More...

#include <Plan13.h>

Public Member Functions

 DateTime (int year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t seconds)
 Constructor to initialize to a calendar date and clock time. More...
 
 DateTime (bool setToNow=false)
 Default constructor with the option to initialzie to current time. More...
 
 DateTime (const DateTime &)=default
 
DateTimeoperator= (const DateTime &source)=default
 
void settime (int year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t seconds)
 Set the DateTime from calendar date and clock time. More...
 
std::tuple< int, uint, uint, uint, uint, uint > gettime () const
 Compute the calendar date and clock time. More...
 
time_t mktime () const
 
bool operator< (const DateTime &rhs) const
 
bool operator> (const DateTime &rhs) const
 
DateTime operator+ (long seconds)
 
DateTimeoperator+= (long seconds)
 
DateTime operator+ (double days)
 
DateTimeoperator+= (double days)
 
double operator- (const DateTime &rhs) const
 
void userNow ()
 
std::ostream & print_on (std::ostream &os) const
 

Static Public Member Functions

static long fnday (long year, uint8_t month, uint8_t day)
 Compute the day-in-space give the calendar year, month and day. More...
 
static std::tuple< int, uint8_t, uint8_t > fndate (long dt)
 Compute the calendar date from the day-in-space. More...
 

Public Attributes

long DN
 
double TN
 

Detailed Description

Encapsulate the day-in-space for orbital mechanics computations.

Constructor & Destructor Documentation

◆ DateTime() [1/2]

DateTime::DateTime ( int  year,
uint8_t  month,
uint8_t  day,
uint8_t  hour,
uint8_t  minute,
uint8_t  seconds 
)
inline

Constructor to initialize to a calendar date and clock time.

Parameters
year
month
day
hour
minute
seconds

◆ DateTime() [2/2]

DateTime::DateTime ( bool  setToNow = false)
inlineexplicit

Default constructor with the option to initialzie to current time.

Parameters
setToNowif true, initialize to the current time.

Member Function Documentation

◆ fndate()

std::tuple< int, uint8_t, uint8_t > DateTime::fndate ( long  dt)
static

Compute the calendar date from the day-in-space.

Parameters
dtthe day-in space
Returns
a tuple with the calendar year, month, day

◆ fnday()

long DateTime::fnday ( long  year,
uint8_t  month,
uint8_t  day 
)
static

Compute the day-in-space give the calendar year, month and day.

Parameters
year
month
day
Returns
the day-in-space

◆ gettime()

std::tuple< int, uint, uint, uint, uint, uint > DateTime::gettime ( ) const

Compute the calendar date and clock time.

Returns
a tuple with year, month, day, hour, minute, seconds

◆ settime()

void DateTime::settime ( int  year,
uint8_t  month,
uint8_t  day,
uint8_t  hour,
uint8_t  minute,
uint8_t  seconds 
)

Set the DateTime from calendar date and clock time.

Parameters
year
month
day
hour
minute
seconds

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