A base class for handling time stamps and conversions.
More...
#include <Base.hpp>
|
bool | hasTimeElapsed (int64_t days, int64_t hours, int64_t minutes) const |
| Checks if a certain time duration has elapsed. More...
|
|
bool | operator== (jsonifier::string_view other) const |
| Checks if the time stamp is equal to a string representation. More...
|
|
|
static jsonifier::string | convertMsToDurationString (uint64_t durationInMs) |
| Converts milliseconds into a human-readable duration string. More...
|
|
static jsonifier::string | convertToCurrentISO8601TimeStamp (time_format timeFormat) |
| Converts the current time into an iso8601 time stamp. More...
|
|
static jsonifier::string | convertToFutureISO8601TimeStamp (uint64_t minutesToAdd, uint64_t hoursToAdd, uint64_t daysToAdd, uint64_t monthsToAdd, uint64_t yearsToAdd, time_format timeFormat) |
| Converts given time values into a future iso8601 time stamp. More...
|
|
static jsonifier::string | getISO8601TimeStamp (time_format timeFormat, uint64_t inputTime) |
| Gets an iso8601 time stamp string based on the provided time format. More...
|
|
static uint64_t | getTimeSinceEpoch (uint64_t year, uint64_t month, uint64_t day, uint64_t hour, uint64_t minute, uint64_t second) |
| Gets the time since the unix epoch for the specified date and time. More...
|
|
◆ convertMsToDurationString()
template<typename value_type >
- Parameters
-
durationInMs | duration in milliseconds to convert. |
- Returns
- human-readable duration string.
Definition at line 431 of file Base.hpp.
◆ convertStringToUintTimeStamp()
template<typename value_type >
- Parameters
-
stringTimeStamp | string time stamp to convert. |
- Returns
- converted time value in milliseconds.
Definition at line 605 of file Base.hpp.
◆ convertTimeStampToTimeUnits()
template<typename value_type >
- Parameters
-
originalTimeStamp | original time stamp string. |
- Returns
- converted time value in milliseconds.
Definition at line 590 of file Base.hpp.
◆ convertToCurrentISO8601TimeStamp()
template<typename value_type >
- Parameters
-
timeFormat | format for the resulting time stamp. |
- Returns
- iso8601 time stamp string.
Definition at line 376 of file Base.hpp.
◆ convertToFutureISO8601TimeStamp()
template<typename value_type >
static jsonifier::string discord_core_api::time_stamp_base< value_type >::convertToFutureISO8601TimeStamp |
( |
uint64_t |
minutesToAdd, |
|
|
uint64_t |
hoursToAdd, |
|
|
uint64_t |
daysToAdd, |
|
|
uint64_t |
monthsToAdd, |
|
|
uint64_t |
yearsToAdd, |
|
|
time_format |
timeFormat |
|
) |
| |
|
inlinestatic |
- Parameters
-
minutesToAdd | number of minutes to add. |
hoursToAdd | number of hours to add. |
daysToAdd | number of days to add. |
monthsToAdd | number of months to add. |
yearsToAdd | number of years to add. |
timeFormat | format for the resulting time stamp. |
- Returns
- iso8601 time stamp string.
Definition at line 334 of file Base.hpp.
◆ convertUintToStringTimeStamp()
template<typename value_type >
- Parameters
-
uintTimeStamp | time value to convert. |
- Returns
- string time stamp.
Definition at line 612 of file Base.hpp.
◆ getISO8601TimeStamp()
template<typename value_type >
- Parameters
-
timeFormat | format for the resulting time stamp. |
inputTime | input time value. |
- Returns
- iso8601 time stamp string.
Definition at line 458 of file Base.hpp.
◆ getTimeSinceEpoch()
template<typename value_type >
static uint64_t discord_core_api::time_stamp_base< value_type >::getTimeSinceEpoch |
( |
uint64_t |
year, |
|
|
uint64_t |
month, |
|
|
uint64_t |
day, |
|
|
uint64_t |
hour, |
|
|
uint64_t |
minute, |
|
|
uint64_t |
second |
|
) |
| |
|
inlinestatic |
- Parameters
-
year | year. |
month | month. |
day | day. |
hour | hour. |
minute | minute. |
second | second. |
- Returns
- time since unix epoch in milliseconds.
Definition at line 510 of file Base.hpp.
◆ hasTimeElapsed()
template<typename value_type >
- Parameters
-
days | number of days for elapsed time. |
hours | number of hours for elapsed time. |
minutes | number of minutes for elapsed time. |
- Returns
- true if the specified time has elapsed, otherwise false.
Definition at line 407 of file Base.hpp.
◆ operator==()
template<typename value_type >
- Parameters
-
other | the string to compare with. |
- Returns
- true if equal, false otherwise.
Definition at line 322 of file Base.hpp.
The documentation for this class was generated from the following file: