VieSched++
VieVS VLBI Scheduling Software
DateTime Class Reference

Represents an instance in time. More...

#include <DateTime.h>

Public Member Functions

 DateTime ()
 
 DateTime (int64_t ticks)
 
 DateTime (unsigned int year, double doy)
 
 DateTime (int year, int month, int day)
 
 DateTime (int year, int month, int day, int hour, int minute, int second)
 
void Initialise (int year, int month, int day, int hour, int minute, int second, int microsecond)
 
int DayOfYear (int year, int month, int day) const
 
double AbsoluteDays (unsigned int year, double doy) const
 
int AbsoluteDays (int year, int month, int day) const
 
TimeSpan TimeOfDay () const
 
int DayOfWeek () const
 
bool Equals (const DateTime &dt) const
 
int Compare (const DateTime &dt) const
 
DateTime AddYears (const int years) const
 
DateTime AddMonths (const int months) const
 
DateTime Add (const TimeSpan &t) const
 
DateTime AddDays (const double days) const
 
DateTime AddHours (const double hours) const
 
DateTime AddMinutes (const double minutes) const
 
DateTime AddSeconds (const double seconds) const
 
DateTime AddMicroseconds (const double microseconds) const
 
DateTime AddTicks (int64_t ticks) const
 
int64_t Ticks () const
 
void FromTicks (int &year, int &month, int &day) const
 
int Year () const
 
int Month () const
 
int Day () const
 
int Hour () const
 
int Minute () const
 
int Second () const
 
int Microsecond () const
 
double ToJulian () const
 
double ToGreenwichSiderealTime () const
 
double ToJ2000 () const
 
double ToLocalMeanSiderealTime (const double lon) const
 
std::string ToString () const
 

Static Public Member Functions

static DateTime Now (bool useMicroseconds=false)
 
static bool IsLeapYear (int year)
 
static bool IsValidYear (int year)
 
static bool IsValidYearMonth (int year, int month)
 
static bool IsValidYearMonthDay (int year, int month, int day)
 
static int DaysInMonth (int year, int month)
 

Private Attributes

int64_t m_encoded
 

Detailed Description

Represents an instance in time.

Constructor & Destructor Documentation

DateTime::DateTime ( )
inline

Default contructor Initialise to 0001/01/01 00:00:00.000000

Here is the call graph for this function:

Here is the caller graph for this function:

DateTime::DateTime ( int64_t  ticks)
inline

Constructor

Parameters
[in]ticksraw tick value
DateTime::DateTime ( unsigned int  year,
double  doy 
)
inline

Constructor

Parameters
[in]yearthe year
[in]doythe day of the year

Here is the call graph for this function:

DateTime::DateTime ( int  year,
int  month,
int  day 
)
inline

Constructor

Parameters
[in]yearthe year
[in]monththe month
[in]daythe day

Here is the call graph for this function:

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

Constructor

Parameters
[in]yearthe year
[in]monththe month
[in]daythe day
[in]hourthe hour
[in]minutethe minute
[in]secondthe second

Here is the call graph for this function:

Member Function Documentation

double DateTime::AbsoluteDays ( unsigned int  year,
double  doy 
) const
inline

Here is the caller graph for this function:

int DateTime::AbsoluteDays ( int  year,
int  month,
int  day 
) const
inline

Here is the call graph for this function:

DateTime DateTime::Add ( const TimeSpan t) const
inline

Add a TimeSpan to this DateTime

Parameters
[in]tthe TimeSpan to add
Returns
a DateTime which has the given TimeSpan added

Here is the call graph for this function:

DateTime DateTime::AddDays ( const double  days) const
inline

Here is the call graph for this function:

DateTime DateTime::AddHours ( const double  hours) const
inline

Here is the call graph for this function:

DateTime DateTime::AddMicroseconds ( const double  microseconds) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

DateTime DateTime::AddMinutes ( const double  minutes) const
inline

Here is the call graph for this function:

DateTime DateTime::AddMonths ( const int  months) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

DateTime DateTime::AddSeconds ( const double  seconds) const
inline

Here is the call graph for this function:

DateTime DateTime::AddTicks ( int64_t  ticks) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

DateTime DateTime::AddYears ( const int  years) const
inline

Here is the call graph for this function:

int DateTime::Compare ( const DateTime dt) const
inline

Here is the caller graph for this function:

int DateTime::Day ( ) const
inline

Here is the call graph for this function:

int DateTime::DayOfWeek ( ) const
inline
int DateTime::DayOfYear ( int  year,
int  month,
int  day 
) const
inline

Find the day of the year given the year/month/day

Parameters
[in]yearthe year
[in]monththe month
[in]daythe day
Returns
the day of the year

Here is the call graph for this function:

Here is the caller graph for this function:

static int DateTime::DaysInMonth ( int  year,
int  month 
)
inlinestatic

Find the number of days in a month given the year/month

Parameters
[in]yearthe year
[in]monththe month
Returns
the days in the given month

Here is the call graph for this function:

Here is the caller graph for this function:

bool DateTime::Equals ( const DateTime dt) const
inline

Here is the caller graph for this function:

void DateTime::FromTicks ( int &  year,
int &  month,
int &  day 
) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

int DateTime::Hour ( ) const
inline

Hour component

Returns
the hour component

Here is the caller graph for this function:

void DateTime::Initialise ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  microsecond 
)
inline

Constructor

Parameters
[in]yearthe year
[in]monththe month
[in]daythe day
[in]hourthe hour
[in]minutethe minute
[in]secondthe second
[in]microsecondthe microsecond

Here is the call graph for this function:

Here is the caller graph for this function:

static bool DateTime::IsLeapYear ( int  year)
inlinestatic

Find whether a year is a leap year

Parameters
[in]yearthe year to check
Returns
whether the year is a leap year

Here is the call graph for this function:

Here is the caller graph for this function:

static bool DateTime::IsValidYear ( int  year)
inlinestatic

Checks whether the given year is valid

Parameters
[in]yearthe year to check
Returns
whether the year is valid

Here is the caller graph for this function:

static bool DateTime::IsValidYearMonth ( int  year,
int  month 
)
inlinestatic

Check whether the year/month is valid

Parameters
[in]yearthe year to check
[in]monththe month to check
Returns
whether the year/month is valid

Here is the call graph for this function:

Here is the caller graph for this function:

static bool DateTime::IsValidYearMonthDay ( int  year,
int  month,
int  day 
)
inlinestatic

Check whether the year/month/day is valid

Parameters
[in]yearthe year to check
[in]monththe month to check
[in]daythe day to check
Returns
whether the year/month/day is valid

Here is the call graph for this function:

Here is the caller graph for this function:

int DateTime::Microsecond ( ) const
inline

Microsecond component

Returns
the microsecond component

Here is the caller graph for this function:

int DateTime::Minute ( ) const
inline

Minute component

Returns
the minute component

Here is the caller graph for this function:

int DateTime::Month ( ) const
inline

Here is the call graph for this function:

static DateTime DateTime::Now ( bool  useMicroseconds = false)
inlinestatic

Return the current time

Parameters
[in]microsecondswhether to set the microsecond component
Returns
a DateTime object set to the current date and time

Here is the call graph for this function:

int DateTime::Second ( ) const
inline

Second component

Returns
the Second component

Here is the caller graph for this function:

int64_t DateTime::Ticks ( ) const
inline

Get the number of ticks

Returns
the number of ticks

Here is the caller graph for this function:

TimeSpan DateTime::TimeOfDay ( ) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

double DateTime::ToGreenwichSiderealTime ( ) const
inline

Convert to greenwich sidereal time

Returns
the greenwich sidereal time

Here is the call graph for this function:

Here is the caller graph for this function:

double DateTime::ToJ2000 ( ) const
inline

Return the modified julian date since the j2000 epoch January 1, 2000, at 12:00 TT

Returns
the modified julian date

Here is the call graph for this function:

double DateTime::ToJulian ( ) const
inline

Convert to a julian date

Returns
the julian date

Here is the call graph for this function:

Here is the caller graph for this function:

double DateTime::ToLocalMeanSiderealTime ( const double  lon) const
inline

Convert to local mean sidereal time (GMST plus the observer's longitude)

Parameters
[in]lonobservers longitude
Returns
the local mean sidereal time

Here is the call graph for this function:

std::string DateTime::ToString ( ) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

int DateTime::Year ( ) const
inline

Here is the call graph for this function:

Member Data Documentation

int64_t DateTime::m_encoded
private

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