|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
The DODS Date/Time class is used to represent and compute with combined date and time values. More...
#include <DODS_Date_Time.h>

Public Member Functions | |
| double | get_epsilon () const |
| Get the value of epsilon used for equality tests of time. More... | |
| bool | OK () const |
| Class invariant. More... | |
| void | set_epsilon (double eps) |
| Set the value of epsilon used for equality tests of time. More... | |
Constructors | |
| DODS_Date_Time () | |
| Create an empty instance. More... | |
| DODS_Date_Time (DODS_Date d, DODS_Time t) | |
| Create an instance using DODS_Date and DODS_Time objects. More... | |
| DODS_Date_Time (string date_time) | |
| Create an instance using the string representation of a DODS_Date_Time. More... | |
| DODS_Date_Time (BaseType *date_time) | |
| Create an instance using the string representation of a DODS_Date_Time contained in a DODS Str. More... | |
| DODS_Date_Time (int y, int m, int d, int hh, int mm=0, double ss=0.0, bool gmt=false) | |
| Create an instance using numeric values for the year, ..., seconds. More... | |
| DODS_Date_Time (int y, int yd, int hh, int mm=0, double ss=0.0, bool gmt=false) | |
| Create an instance using numeric values for the year, ..., seconds. More... | |
Assignment | |
| void | set (DODS_Date d, DODS_Time t) |
| Set an instance using DODS_Date and DODS_Time objects. More... | |
| void | set (string date_time) |
| Set an instance using the string representation of a DODS_Date_Time. More... | |
| void | set (BaseType *date_time) |
| Set an instance using the string representation of a DODS_Date_Time contained in a DODS Str. More... | |
| void | set (int y, int m, int d, int hh, int mm=0, double ss=0.0, bool gmt=false) |
| Set an instance using numeric values for the year, ..., seconds. More... | |
| void | set (int y, int yd, int hh, int mm=0, double ss=0.0, bool gmt=false) |
| Set an instance using numeric values for the year, ..., seconds. More... | |
Access | |
| int | year () const |
| int | month () const |
| int | day () const |
| int | day_number () const |
| int | hours () const |
| int | minutes () const |
| double | seconds () const |
| bool | gmt () const |
| string | get (date_format format=ymd, bool gmt=true) const |
| Get the string representation of the date/time. More... | |
| double | julian_day () const |
| time_t | unix_time () const |
| Return the number of seconds since 00:00:00 UTC 1 Jan 1970. More... | |
Friends | |
Relational operators | |
| int | operator== (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Equality. More... | |
| int | operator!= (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Inequality. More... | |
| int | operator< (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Less-than. More... | |
| int | operator> (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Greater-than. More... | |
| int | operator<= (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Less-than or Equal-to. More... | |
| int | operator>= (DODS_Date_Time &t1, DODS_Date_Time &t2) |
| Greater-than or Equal-to. More... | |
The DODS Date/Time class is used to represent and compute with combined date and time values.
Definition at line 47 of file DODS_Date_Time.h.
| DODS_Date_Time::DODS_Date_Time | ( | ) |
Create an empty instance.
Will not pass the class invariant.
Definition at line 89 of file DODS_Date_Time.cc.
| DODS_Date_Time::DODS_Date_Time | ( | string | date_time | ) |
Create an instance using the string representation of a DODS_Date_Time.
| date_time | The date/time string. |
| DODS_Date_Time::DODS_Date_Time | ( | BaseType * | date_time | ) |
Create an instance using the string representation of a DODS_Date_Time contained in a DODS Str.
| date_time | The date/time string (in a DODS Str pointer). |
Definition at line 103 of file DODS_Date_Time.cc.
References set().

| DODS_Date_Time::DODS_Date_Time | ( | int | y, |
| int | m, | ||
| int | d, | ||
| int | hh, | ||
| int | mm = 0, |
||
| double | ss = 0.0, |
||
| bool | gmt = false |
||
| ) |
Create an instance using numeric values for the year, ..., seconds.
| y | The year number, 1 is 1 A.D. |
| m | The month, 1 is January, ..., 12 is December. |
| d | The day. |
| hh | The hour, 0...23. |
| mm | The minute, 0...59. |
| ss | The seconds, 0.0, ..., 59.999... |
| gmt | True if the time is a GMT time, false otherwise. |
Definition at line 108 of file DODS_Date_Time.cc.
References set().

| DODS_Date_Time::DODS_Date_Time | ( | int | y, |
| int | yd, | ||
| int | hh, | ||
| int | mm = 0, |
||
| double | ss = 0.0, |
||
| bool | gmt = false |
||
| ) |
Create an instance using numeric values for the year, ..., seconds.
| y | The year number, 1 is 1 A.D. |
| yd | The year-day, 1 is 1 January, 365/366 is 31 December. |
| hh | The hour, 0...23. |
| mm | The minute, 0...59. |
| ss | The seconds, 0.0, ..., 59.999... |
| gmt | True if the time is a GMT time, false otherwise. |
Definition at line 114 of file DODS_Date_Time.cc.
References set().

| int DODS_Date_Time::day | ( | ) | const |
Definition at line 259 of file DODS_Date_Time.cc.
References DODS_Date::day().

| int DODS_Date_Time::day_number | ( | ) | const |
Definition at line 265 of file DODS_Date_Time.cc.
References DODS_Date::day_number().

| string DODS_Date_Time::get | ( | date_format | format = ymd, |
| bool | gmt = true |
||
| ) | const |
Get the string representation of the date/time.
If #format# is ymd#, return the date-time using yyyy/mm/dd:hh:mm:ss notation, if it is yd#, use yyyy/ddd... notation. If gmt# is true, append GMT to times that are GMT times, if false, don't (ever) append the GMT suffix.
| format | The format of the date-part. |
| gmt | Append the GMT suffix to GMT times. |
Definition at line 295 of file DODS_Date_Time.cc.
References assert, days_in_year(), decimal, DODS_Time::fraction(), DODS_Date::fraction(), DODS_Time::get(), DODS_Date::get(), yd, DODS_Date::year(), and ymd.

| double DODS_Date_Time::get_epsilon | ( | ) | const |
Get the value of epsilon used for equality tests of time.
Definition at line 344 of file DODS_Date_Time.cc.
References DODS_Time::get_epsilon().

| bool DODS_Date_Time::gmt | ( | ) | const |
Definition at line 289 of file DODS_Date_Time.cc.
References DODS_Time::gmt().

| int DODS_Date_Time::hours | ( | ) | const |
Definition at line 271 of file DODS_Date_Time.cc.
References DODS_Time::hours().

| double DODS_Date_Time::julian_day | ( | ) | const |
Definition at line 323 of file DODS_Date_Time.cc.
References DODS_Date::julian_day(), seconds_per_day, and DODS_Time::seconds_since_midnight().

| int DODS_Date_Time::minutes | ( | ) | const |
Definition at line 277 of file DODS_Date_Time.cc.
References DODS_Time::minutes().

| int DODS_Date_Time::month | ( | ) | const |
Definition at line 253 of file DODS_Date_Time.cc.
References DODS_Date::month().

| bool DODS_Date_Time::OK | ( | ) | const |
Class invariant.
Definition at line 84 of file DODS_Date_Time.cc.
Referenced by set().
| double DODS_Date_Time::seconds | ( | ) | const |
Definition at line 283 of file DODS_Date_Time.cc.
References DODS_Time::seconds().

Set an instance using DODS_Date and DODS_Time objects.
Definition at line 121 of file DODS_Date_Time.cc.
Referenced by DODS_Date_Time(), and set().

| void DODS_Date_Time::set | ( | string | date_time | ) |
Set an instance using the string representation of a DODS_Date_Time.
| date_time | The date/time string. |
| void DODS_Date_Time::set | ( | BaseType * | date_time | ) |
Set an instance using the string representation of a DODS_Date_Time contained in a DODS Str.
| date_time | The date/time string (in a DODS Str pointer). |
Definition at line 223 of file DODS_Date_Time.cc.
References set().

| void DODS_Date_Time::set | ( | int | y, |
| int | m, | ||
| int | d, | ||
| int | hh, | ||
| int | mm = 0, |
||
| double | ss = 0.0, |
||
| bool | gmt = false |
||
| ) |
Set an instance using numeric values for the year, ..., seconds.
| y | The year number, 1 is 1 A.D. |
| m | The month, 1 is January, ..., 12 is December. |
| d | The day. |
| hh | The hour, 0...23. |
| mm | The minute, 0...59. |
| ss | The seconds, 0.0, ..., 59.999... |
| gmt | True if the time is a GMT time, false otherwise. |
Definition at line 229 of file DODS_Date_Time.cc.
References assert, OK(), DODS_Time::set(), and DODS_Date::set().

| void DODS_Date_Time::set | ( | int | y, |
| int | yd, | ||
| int | hh, | ||
| int | mm = 0, |
||
| double | ss = 0.0, |
||
| bool | gmt = false |
||
| ) |
Set an instance using numeric values for the year, ..., seconds.
| y | The year number, 1 is 1 A.D. |
| yd | The year-day, 1 is 1 January, 365/366 is 31 December. |
| hh | The hour, 0...23. |
| mm | The minute, 0...59. |
| ss | The seconds, 0.0, ..., 59.999... |
| gmt | True if the time is a GMT time, false otherwise. |
Definition at line 238 of file DODS_Date_Time.cc.
References assert, OK(), DODS_Time::set(), and DODS_Date::set().

| void DODS_Date_Time::set_epsilon | ( | double | eps | ) |
Set the value of epsilon used for equality tests of time.
By default the value is 0.000001 (10e-6).
NB: This should rarely be changed.
Definition at line 350 of file DODS_Date_Time.cc.
References DODS_Time::set_epsilon().

| time_t DODS_Date_Time::unix_time | ( | ) | const |
Return the number of seconds since 00:00:00 UTC 1 Jan 1970.
If the date is before 1 Jan 1970, return DODS_UINT_MAX. If the date is too late to represent as seconds since 1 Jan 1970, return DODS_UINT_MAX. Each day starts at 00:00:00 UTC.
Definition at line 329 of file DODS_Date_Time.cc.
References DODS_Date::day(), DODS_Time::hours(), DODS_Time::minutes(), DODS_Date::month(), DODS_Time::seconds(), and DODS_Date::year().

| int DODS_Date_Time::year | ( | ) | const |
Definition at line 247 of file DODS_Date_Time.cc.
References DODS_Date::year().

|
friend |
Inequality.
Definition at line 362 of file DODS_Date_Time.cc.
|
friend |
Less-than.
Definition at line 368 of file DODS_Date_Time.cc.
|
friend |
Less-than or Equal-to.
Definition at line 382 of file DODS_Date_Time.cc.
|
friend |
Equality.
Definition at line 356 of file DODS_Date_Time.cc.
|
friend |
Greater-than.
Definition at line 375 of file DODS_Date_Time.cc.
|
friend |
Greater-than or Equal-to.
Definition at line 388 of file DODS_Date_Time.cc.