Skip to content

Commit

Permalink
doc: fix doc comment in time_point.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashigeru committed Jul 17, 2024
1 parent 75e2bf2 commit ed19ff0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions include/takatori/datetime/time_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
namespace takatori::datetime {

/**
* @brief represents time point since 1970-01-01 00:00:00 GMT.
* @brief represents time point since the "epoch" as 1970-01-01 00:00:00.
* @details This epoch depends on the kind of time which the object represents.
* For example, if the object represents a local time, the epoch is 1970-01-01 00:00:00 of its local time.
* Otherwise, if the object represents a zoned time, the epoch is 1970-01-01 00:00:00 of the **GMT**.
*/
class time_point {
public:
Expand All @@ -26,13 +29,13 @@ class time_point {
using difference_type = std::chrono::nanoseconds;

/**
* @brief creates a new instance of the epoch time, which represents 1970-01-01 00:00:00 GMT.
* @brief creates a new instance of the epoch time, which represents 1970-01-01 00:00:00.
*/
constexpr time_point() noexcept = default;

/**
* @brief creates a new instance
* @param offset seconds since 1970-01-01 00:00:00 GMT, ignoring leap seconds
* @param offset seconds since 1970-01-01 00:00:00, ignoring leap seconds
* @param adjustment the sub-second value
*/
explicit constexpr time_point(offset_type offset, difference_type adjustment = {}) noexcept :
Expand All @@ -46,7 +49,7 @@ class time_point {

/**
* @brief creates a new instance
* @param offset elapsed time since 1970-01-01 00:00:00 GMT, ignoring leap seconds
* @param offset elapsed time since 1970-01-01 00:00:00, ignoring leap seconds
*/
template<class Rep, class Period>
explicit constexpr time_point(std::chrono::duration<Rep, Period> offset) noexcept :
Expand All @@ -57,8 +60,8 @@ class time_point {

/**
* @brief creates a new instance from date and time.
* @param date date in GMT
* @param time time of the date
* @param date date
* @param time time of the day
*/
explicit time_point(datetime::date date, datetime::time_of_day time = {}) noexcept;

Expand All @@ -80,7 +83,7 @@ class time_point {
[[nodiscard]] static time_point now();

/**
* @brief returns the offset since epoch (1970-01-01 00:00:00 GMT), ignoring leap seconds.
* @brief returns the offset since epoch (1970-01-01 00:00:00), ignoring leap seconds.
* @details the returned value does not contain sub-seconds value, please check nano_adjustments()
* @return the seconds offset since epoch
*/
Expand All @@ -97,7 +100,7 @@ class time_point {
}

/**
* @brief returns the date of the time point (in GMT).
* @brief returns the date of the time point.
* @return the date
*/
[[nodiscard]] datetime::date date() const {
Expand All @@ -107,7 +110,7 @@ class time_point {
}

/**
* @brief returns the time in day of the time point (in GMT).
* @brief returns the time in day of the time point.
* @return the time in day
*/
[[nodiscard]] constexpr datetime::time_of_day time() const noexcept {
Expand All @@ -120,7 +123,7 @@ class time_point {
}

/**
* @brief returns a pair of date and time of the time point (in GMT).
* @brief returns a pair of date and time of the time point.
* @return the date and time
* @see calendar
*/
Expand Down

0 comments on commit ed19ff0

Please sign in to comment.