Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Dec 5, 2024
1 parent 586cb61 commit 8630497
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions include/tpdate2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ namespace dso {
* A TwoPartDate instance conviniently splits a datetime into two numeric
* values:
* - the Modified Julian Day (i.e. an integral value), and
* - the time of day, which is stored in fractional seconds of day
*
* The methods of the class, invluding constructors, take special care to
* always keep the seconds as seconds of day, i.e. in the range [0,86400) and
* correspondingly increase/decrease the day count.
* - the time of day, which is stored in fractional days (always in [0,1)).
*
*/
class TwoPartDate2 {
Expand Down Expand Up @@ -61,6 +57,12 @@ class TwoPartDate2 {
: _mjd(b), _fday(s.seconds() / SEC_PER_DAY) {
this->normalize();
}

explicit TwoPartDate2(int b = 0,
FractionalDays d = FractionalDays{0}) noexcept
: _mjd(b), _fday(d.days()) {
this->normalize();
}

/** Get the MJD as an intgral number, i.e. no fractional part */
int imjd() const noexcept { return _mjd; }
Expand Down

0 comments on commit 8630497

Please sign in to comment.