|
neic-glass3
1.4.6
|
time translation class More...
#include <date.h>

Public Member Functions | |
| Date () | |
| CDate default constructor. More... | |
| Date (double time) | |
| CDate advanced constructor. More... | |
| Date (unsigned int year, unsigned int month, unsigned int day, unsigned int hour, unsigned int minutes, double seconds) | |
| CDate advanced constructor. More... | |
| Date (std::string time) | |
| CDate advanced constructor. More... | |
| ~Date () | |
| CDate destructor. More... | |
| void | clear () |
| CDate clear function. More... | |
| bool | initialize (double time) |
| CDate initialize function. More... | |
| bool | initialize (unsigned int year, unsigned int month, unsigned int day, unsigned int hour, unsigned int minutes, double seconds) |
| CDate alternate initialize function. More... | |
| bool | initialize (std::string time) |
| CDate alternate initialize function. More... | |
| unsigned int | year () |
| Get the gregorian year. More... | |
| unsigned int | month () |
| Get the gregorian month. More... | |
| unsigned int | day () |
| Get the gregorian day. More... | |
| unsigned int | hour () |
| Get the gregorian hour. More... | |
| unsigned int | minute () |
| Get the gregorian minute. More... | |
| double | seconds () |
| Get the gregorian seconds. More... | |
| double | time () |
| Get the Gregorian seconds. More... | |
| std::string | date18 () |
| Calculate the 20 character date string. More... | |
| std::string | date20 () |
| Calculate the 18 character date string. More... | |
| std::string | ISO8601 () |
| Calculate the ISO8601 date string. More... | |
| std::string | dateTime () |
| Calculate the DateTime date string. More... | |
| double | decodeDateTime (std::string datetime) |
| Decode the datetime format date string into Gregorian seconds. More... | |
| double | decodeISO8601Time (std::string iso8601) |
| Decode the ISO8601 date string into Gregorian seconds. More... | |
Static Public Member Functions | |
| static double | now () |
| CDate current time function. More... | |
| static std::string | encodeDateTime (double t) |
| Calculate (encode) the date time date string. More... | |
| static std::string | encodeISO8601Time (double t) |
| Calculate (encode) the ISO8610 date string. More... | |
| static std::string | convertEpochTimeToISO8601 (double epochTime) |
| Convert time from epoch time to ISO8601. More... | |
| static std::string | convertEpochTimeToISO8601 (std::time_t epochTime, double decimalSeconds=0) |
| Convert time from epoch time to ISO8601. More... | |
| static std::string | convertDateTimeToISO8601 (const std::string &timeString) |
| Convert time from date time format to ISO8601 format. More... | |
| static double | convertDateTimeToEpochTime (const std::string &timeString) |
| Convert time from date time to epoch time. More... | |
| static double | convertISO8601ToEpochTime (const std::string &timeString) |
| Convert time from ISO8601 time to epoch time. More... | |
Protected Attributes | |
| unsigned int | m_nYear |
| An unsigned integer variable containing the gregorian year. More... | |
| unsigned int | m_nMonth |
| An unsigned integer variable containing the gregorian month. More... | |
| unsigned int | m_nDay |
| An unsigned integer variable containing the gregorian day. More... | |
| unsigned int | m_nHour |
| An unsigned integer variable containing the gregorian hour. More... | |
| unsigned int | m_nMinute |
| An unsigned integer variable containing the gregorian minute. More... | |
| double | m_dSeconds |
| A double variable containing the gregorian seconds. More... | |
| double | m_dTime |
| A double variable containing the Gregorian seconds. More... | |
time translation class
The date class is a class that stores time/date information and supports converting time/ date information between various formats external (human) and internal (epoch time, ISO8601, etc.) storing date internally as a double containing Gregorian seconds.
| glass3::util::Date::Date | ( | ) |
CDate default constructor.
The default constructor for the CDate class.
|
explicit |
CDate advanced constructor.
An advanced constructor for the CDate class, initializes the class from a provided time in Gregorian seconds.
| time | - A double value containing the time in Gregorian seconds |
| glass3::util::Date::Date | ( | unsigned int | year, |
| unsigned int | month, | ||
| unsigned int | day, | ||
| unsigned int | hour, | ||
| unsigned int | minutes, | ||
| double | seconds | ||
| ) |
CDate advanced constructor.
An advanced constructor for the CDate class, initializes the class from a provided gregorian date/time.
| year | - An unsigned integer value containing the year |
| month | - An unsigned integer value containing the month |
| day | - An unsigned integer value containing the day |
| hour | - An unsigned integer value containing the hour |
| minutes | - An unsigned integer value containing the minutes |
| seconds | - A double value containing the seconds |
|
explicit |
CDate advanced constructor.
An advanced constructor for the CDate class, initializes the class from a provided time string.
| time | - A string value containing the time |
| glass3::util::Date::~Date | ( | ) |
CDate destructor.
The destructor for the CDate class.
| void glass3::util::Date::clear | ( | ) |
CDate clear function.
CDate clear function
|
static |
Convert time from date time to epoch time.
Convert the given DateTime time string in the format YYYYMMDDHHMMSS.SSS to an epoch time (seconds from 1970)
For more information on epoch time, see https://en.wikipedia.org/wiki/Unix_time
| timeString | - A std::string containing the date time in the format YYYYMMDDHHMMSS.SSS |
|
static |
Convert time from date time format to ISO8601 format.
Convert the given DateTime time string in the format YYYYMMDDHHMMSS.SSS to an ISO8601 time string in the format YYYY-MM-DDTHH:MM:SS.SSSZ
For more information on ISO8601, see https://en.wikipedia.org/wiki/ISO_8601
| timeString | - A std::string containing the date time in the format YYYYMMDDHHMMSS.SS |
|
static |
Convert time from epoch time to ISO8601.
Convert the given epoch time (seconds from 1970) from decimal seconds to an ISO8601 time string in the format YYYY-MM-DDTHH:MM:SS.SSSZ
For more information on epoch time, see https://en.wikipedia.org/wiki/Unix_time
For more information on ISO8601, see https://en.wikipedia.org/wiki/ISO_8601
| epochTime | - A double containing the epoch time (seconds from 1970) |
|
static |
Convert time from epoch time to ISO8601.
Convert the given epoch time (seconds from 1970) from decimal seconds to an ISO8601 time string
For more information on epoch time, see https://en.wikipedia.org/wiki/Unix_time
For more information on ISO8601, see https://en.wikipedia.org/wiki/ISO_8601
| epochTime | - A time_t containing the epoch time (seconds from 1970) |
| decimalSeconds | - A an optional double containing the decimal seconds, default is 0 |
|
static |
Convert time from ISO8601 time to epoch time.
Convert the given ISO8601 string in the format YYYY-MM-DDTHH:MM:SS.SSSZ to an epoch time
For more information on epoch time, see https://en.wikipedia.org/wiki/Unix_time
For more information on ISO8601, see https://en.wikipedia.org/wiki/ISO_8601
| timeString | - A std::string containing the ISO8601 time in the format YYYY-MM-DDTHH:MM:SS.SSSZ |
| std::string glass3::util::Date::date18 | ( | ) |
Calculate the 20 character date string.
Calculate the 20 character date string in the form 1988Jan23 1234 12.21 from the Gregorian seconds.
| std::string glass3::util::Date::date20 | ( | ) |
Calculate the 18 character date string.
Calculate the 18 character date string in the form 88Jan23 1234 12.21 from the Gregorian seconds.
| std::string glass3::util::Date::dateTime | ( | ) |
Calculate the DateTime date string.
Calculate the date time string in the form 'yyyymmddhhmmss.sss' from the Gregorian seconds assuming base time is already UTC.
| unsigned int glass3::util::Date::day | ( | ) |
Get the gregorian day.
Get the current gregorian day
| double glass3::util::Date::decodeDateTime | ( | std::string | datetime | ) |
Decode the datetime format date string into Gregorian seconds.
Decode the datetime format date string 'yyyymmddhhmmss.sss' into Gregorian seconds.
| double glass3::util::Date::decodeISO8601Time | ( | std::string | iso8601 | ) |
Decode the ISO8601 date string into Gregorian seconds.
Decode the ISO8601 format date string 'YYYY-MM-DDTHH:MM:SS.SSSZ' into Gregorian seconds.
|
static |
Calculate (encode) the date time date string.
Calculate the date time string in the form 'yyyymmddhhmmss.sss' from the Gregorian seconds assuming base time is already UTC.
|
static |
Calculate (encode) the ISO8610 date string.
Calculate the ISO8601 date string in the form 'YYYY-MM-DDTHH:MM:SS.SSSZ' from the Gregorian seconds assuming base time is already UTC.
| unsigned int glass3::util::Date::hour | ( | ) |
Get the gregorian hour.
Get the current gregorian hour
| bool glass3::util::Date::initialize | ( | double | time | ) |
CDate initialize function.
Initialize function for the CDate class, initializes the class from a provided time in Gregorian seconds.
| time | - A double value containing the time in Gregorian seconds |
| bool glass3::util::Date::initialize | ( | unsigned int | year, |
| unsigned int | month, | ||
| unsigned int | day, | ||
| unsigned int | hour, | ||
| unsigned int | minutes, | ||
| double | seconds | ||
| ) |
CDate alternate initialize function.
Initialize function for the CDate class, initializes the class from a provided gregorian date/time.
| year | - An unsigned integer value containing the year |
| month | - An unsigned integer value containing the month |
| day | - An unsigned integer value containing the day |
| hour | - An unsigned integer value containing the hour |
| minutes | - An unsigned integer value containing the minutes |
| seconds | - A double value containing the seconds |
| bool glass3::util::Date::initialize | ( | std::string | time | ) |
CDate alternate initialize function.
Initialize function for the CDate class, initializes the class from a provided time string.
| time | - A string value containing the time |
| std::string glass3::util::Date::ISO8601 | ( | ) |
Calculate the ISO8601 date string.
Calculate the ISO8601 date string in the form 'YYYY-MM-DDTHH:MM:SS.SSSZ' from the Gregorian seconds assuming base time is already UTC.
| unsigned int glass3::util::Date::minute | ( | ) |
Get the gregorian minute.
Get the current gregorian minute
| unsigned int glass3::util::Date::month | ( | ) |
Get the gregorian month.
Get the current gregorian month
|
static |
CDate current time function.
gets the current time in Gregorian seconds
| double glass3::util::Date::seconds | ( | ) |
Get the gregorian seconds.
Get the current gregorian seconds
| double glass3::util::Date::time | ( | ) |
Get the Gregorian seconds.
Get the total Gregorian seconds
| unsigned int glass3::util::Date::year | ( | ) |
Get the gregorian year.
Get the current gregorian year
|
protected |
A double variable containing the gregorian seconds.
|
protected |
A double variable containing the Gregorian seconds.
|
protected |
An unsigned integer variable containing the gregorian day.
|
protected |
An unsigned integer variable containing the gregorian hour.
|
protected |
An unsigned integer variable containing the gregorian minute.
|
protected |
An unsigned integer variable containing the gregorian month.
|
protected |
An unsigned integer variable containing the gregorian year.
1.8.11