diff --git a/chrono/datetime.cpp b/chrono/datetime.cpp index e3f3d2d..48f8ec0 100644 --- a/chrono/datetime.cpp +++ b/chrono/datetime.cpp @@ -5,7 +5,6 @@ #include #include #include -#include using namespace std; using namespace ChronoUtilities; @@ -35,22 +34,6 @@ inline bool inRangeExclMax(num1 val, num2 min, num3 max) return (val) >= (min) && (val) < (max); } -/*! - * \brief Returns a DateTime object that is set to the current date and time on this computer, expressed as the local time. - */ -DateTime DateTime::now() -{ - return DateTime::fromTimeStamp(time(nullptr)); -} - -/*! - * \brief Returns a DateTime object that is set to the current date and time on this computer, expressed as the GMT time. - */ -DateTime DateTime::gmtNow() -{ - return DateTime::fromTimeStampGmt(time(nullptr)); -} - /*! * \class ChronoUtilities::DateTime * \brief Represents an instant in time, typically expressed as a date and time of day. diff --git a/chrono/datetime.h b/chrono/datetime.h index 5398a80..753f3da 100644 --- a/chrono/datetime.h +++ b/chrono/datetime.h @@ -7,6 +7,7 @@ #include #include +#include namespace ChronoUtilities { @@ -315,6 +316,22 @@ constexpr inline DateTime DateTime::eternity() return DateTime(std::numeric_limits::max()); } +/*! + * \brief Returns a DateTime object that is set to the current date and time on this computer, expressed as the local time. + */ +inline DateTime DateTime::now() +{ + return DateTime::fromTimeStamp(time(nullptr)); +} + +/*! + * \brief Returns a DateTime object that is set to the current date and time on this computer, expressed as the GMT time. + */ +inline DateTime DateTime::gmtNow() +{ + return DateTime::fromTimeStampGmt(time(nullptr)); +} + /*! * \brief Indicates whether two DateTime instances are equal. */