bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
#include <DODS_Date.h>
Public Member Functions | |
int | day () const |
int | day_number () const |
DODS_Date (int year, int month, int day) | |
DODS_Date (int year, int month, int day, date_format format) | |
date_format | format () const |
double | fraction () const |
long | julian_day () const |
time_t | unix_time () const |
Constructors | |
DODS_Date () | |
DODS_Date (string date_str) | |
DODS_Date (BaseType *arg) | |
DODS_Date (int year, int day_num) | |
Assignment | |
void | set (string date) |
void | set (BaseType *arg) |
void | set (int year, int day_number) |
void | set (int year, int month, int day) |
void | set (int year, int month, int day, date_format format) |
Access | |
string | get (date_format format=ymd) const |
int | year () const |
int | month () const |
Relational operators | |
bool | OK () const |
int | operator== (DODS_Date &d1, DODS_Date &d2) |
Equality. | |
int | operator!= (DODS_Date &d1, DODS_Date &d2) |
Inequality. | |
int | operator< (DODS_Date &d1, DODS_Date &d2) |
Less than. | |
int | operator> (DODS_Date &d1, DODS_Date &d2) |
Greater than. | |
int | operator<= (DODS_Date &d1, DODS_Date &d2) |
Less than or equal. | |
int | operator>= (DODS_Date &d1, DODS_Date &d2) |
Greater than or equal. | |
The DODS Date object. This provides a way to translate between local representations of dates and the DODS standard representation(s). The DODS_Date object provides constructors, accessors and comparison operations; DODS servers which support the DODS standard representation of dates must implement CE functions that make use of this object.
Definition at line 108 of file DODS_Date.h.
DODS_Date::DODS_Date | ( | ) |
Create an empty date. Set the date using one of the #set_date# mfuncs.
Definition at line 95 of file DODS_Date.cc.
DODS_Date::DODS_Date | ( | string | date_str | ) |
Build a DODS_Date by parsing the string #date_str#. If #date_str# is of the form ‘yyyy/ddd’ assume that it is in year and day-number format. If it is of the form ‘yyyy/mm/dd’ assume it is in year, month and day format. Note that if ‘yyyy’ is ‘98’ that means year 98 A.D., not 1998.
date_str | A string containing the date. |
Definition at line 106 of file DODS_Date.cc.
DODS_Date::DODS_Date | ( | BaseType * | arg | ) |
Build a DODS_Date by parsing the DODS string contained in #arg#.
Throws Error if #arg# is not a DODS Str object.
arg | A DODS string containing the date. |
Definition at line 100 of file DODS_Date.cc.
Build a DODS_Date using year and day-number values. This constructor assumes that the two integers are the year and day-number, respectively.
year | The year. ‘98’ is 98 A.D., not 1998. |
day_num | The day-number, 1 Jan is day 1. |
Definition at line 111 of file DODS_Date.cc.
Definition at line 116 of file DODS_Date.cc.
Definition at line 121 of file DODS_Date.cc.
int DODS_Date::day | ( | ) | const |
).
Definition at line 402 of file DODS_Date.cc.
int DODS_Date::day_number | ( | ) | const |
Definition at line 407 of file DODS_Date.cc.
date_format DODS_Date::format | ( | ) | const |
Definition at line 419 of file DODS_Date.cc.
double DODS_Date::fraction | ( | ) | const |
Definition at line 424 of file DODS_Date.cc.
string DODS_Date::get | ( | date_format | format = ymd | ) | const |
Get the string representation for this date. By default the y/m/d format is used. To get the year/year-day format use yd# for the value of format#.
Throws Error if format# is not ymd# or yd#.
format | The format of the date. |
Definition at line 429 of file DODS_Date.cc.
long DODS_Date::julian_day | ( | ) | const |
Definition at line 412 of file DODS_Date.cc.
int DODS_Date::month | ( | ) | const |
Definition at line 397 of file DODS_Date.cc.
bool DODS_Date::OK | ( | ) | const |
Class invariant.
Definition at line 88 of file DODS_Date.cc.
void DODS_Date::set | ( | BaseType * | arg | ) |
Parse the DODS string and assign the value to this object.
Definition at line 126 of file DODS_Date.cc.
Assign the date using the two integers.
Definition at line 312 of file DODS_Date.cc.
Assign the date using three integers.
Definition at line 324 of file DODS_Date.cc.
Assign the date using three integers and a date_format enumeration.
Definition at line 337 of file DODS_Date.cc.
void DODS_Date::set | ( | string | date | ) |
Parse the string and assign the value to this object.
Definition at line 290 of file DODS_Date.cc.
time_t DODS_Date::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 463 of file DODS_Date.cc.
int DODS_Date::year | ( | ) | const |
Definition at line 392 of file DODS_Date.cc.
Inequality.
Definition at line 360 of file DODS_Date.cc.
Less than.
Definition at line 365 of file DODS_Date.cc.
Less than or equal.
Definition at line 375 of file DODS_Date.cc.
Equality.
Definition at line 349 of file DODS_Date.cc.
Greater than.
Definition at line 370 of file DODS_Date.cc.
Greater than or equal.
Definition at line 383 of file DODS_Date.cc.