#include <PDateTime.h>
Collaboration diagram for PLearn::PDateTime:
Public Member Functions | |
PDateTime () | |
Create a missing date by default. | |
PDateTime (short the_year, unsigned char the_month, unsigned char the_day) | |
Create a date only, with time assumed to be midnight. | |
PDateTime (int the_year, int the_month, int the_day) | |
PDateTime (short the_year, unsigned char the_month, unsigned char the_day, unsigned char the_hour, unsigned char the_min, unsigned char the_sec) | |
Create a full date/time. | |
PDateTime (int the_year, int the_month, int the_day, int the_hour, int the_min, int the_sec) | |
PDateTime (double julian_day) | |
convert a Julian day into a PDateTime. | |
PDateTime (string datetime) | |
Convert a string in "YYYY/MM/DD" or "YYYY/MM/DD hh:mm:ss" into a PDateTime. | |
bool | isMissing () const |
Missing date/time handling. | |
void | setMissing () |
returns the date in the format yyyy/mm/dd hh:mm:ss | |
string | info () const |
bool | operator== (const PDateTime &rhs) const |
Equality comparison. | |
bool | operator!= (const PDateTime &rhs) const |
bool | operator< (const PDateTime &rhs) const |
bool | operator<= (const PDateTime &rhs) const |
bool | operator> (const PDateTime &rhs) const |
bool | operator>= (const PDateTime &rhs) const |
double | toJulianDay () const |
Public Attributes | |
short | year |
ex: 1983, 2001, -350, ... | |
unsigned char | month |
1..12 | |
unsigned char | day |
1..31 | |
unsigned char | hour |
00..23 | |
unsigned char | min |
00..59 | |
unsigned char | sec |
00..61, allowing for leap seconds (!) |
Definition at line 60 of file PDateTime.h.
|
Create a missing date by default.
Definition at line 47 of file PDateTime.cc. References setMissing(). |
|
Create a date only, with time assumed to be midnight.
Definition at line 74 of file PDateTime.h. |
|
Definition at line 78 of file PDateTime.h. |
|
Create a full date/time.
Definition at line 83 of file PDateTime.h. |
|
Definition at line 89 of file PDateTime.h. |
|
convert a Julian day into a PDateTime. Day 0 of the Julian calendar is about 6000 years ago... The julian day is passed as a DOUBLE, to allow specifying hours/minutes/seconds as a FRACTION of days. Definition at line 52 of file PDateTime.cc. References day, PLearn::double_to_hhmmss(), hour, min, month, sec, and year. |
|
Convert a string in "YYYY/MM/DD" or "YYYY/MM/DD hh:mm:ss" into a PDateTime. The format has to match exactly. Definition at line 75 of file PDateTime.cc. References day, hour, PLearn::min(), min, month, PLERROR, sec, PLearn::toint(), and year. |
|
Definition at line 109 of file PDateTime.cc. References day, hour, min, month, PLearn::right(), sec, slash, PLearn::tostring(), and year. Referenced by PLearn::operator<<(). |
|
Missing date/time handling.
Definition at line 97 of file PDateTime.cc. References day, month, and year. Referenced by PLearn::datetime_to_double(). |
|
Definition at line 116 of file PDateTime.h. |
|
Definition at line 120 of file PDateTime.h. References PLearn::datetime_to_double(). |
|
Definition at line 125 of file PDateTime.h. |
|
Equality comparison.
Definition at line 111 of file PDateTime.h. |
|
Definition at line 129 of file PDateTime.h. |
|
Definition at line 133 of file PDateTime.h. |
|
returns the date in the format yyyy/mm/dd hh:mm:ss
Definition at line 102 of file PDateTime.cc. References day, month, and year. Referenced by PDateTime(). |
|
Convert a PDateTime into a Julian day. See http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html (if still existing...) for details. Definition at line 119 of file PDateTime.cc. References day, PLearn::hhmmss_to_double(), hour, min, month, PLERROR, sec, and year. |
|
1..31
Definition at line 65 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), isMissing(), operator==(), PDateTime(), setMissing(), and toJulianDay(). |
|
00..23
Definition at line 66 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), operator==(), PDateTime(), and toJulianDay(). |
|
00..59
Definition at line 67 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), operator==(), PDateTime(), and toJulianDay(). |
|
1..12
Definition at line 64 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), isMissing(), operator==(), PDateTime(), setMissing(), and toJulianDay(). |
|
00..61, allowing for leap seconds (!)
Definition at line 68 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), operator==(), PDateTime(), and toJulianDay(). |
|
ex: 1983, 2001, -350, ...
Definition at line 63 of file PDateTime.h. Referenced by PLearn::datetime_to_double(), PLearn::double_to_datetime(), info(), isMissing(), operator==(), PDateTime(), setMissing(), and toJulianDay(). |