100
100
inline enum calendar calendar() const {return _calendar;}
101
101
/** Returns the nanoseconds component. */
102
102
inline uint32_t nseconds() const {return _nseconds;}
103
/** Sets the useconds component. */
104
inline void set_useconds(const uint32_t usecond) {_useconds= usecond;}
103
105
/** Returns the microsseconds component. */
104
106
inline uint32_t useconds() const {return _useconds;}
107
/** Sets the epoch_seconds component. */
108
virtual void set_epoch_seconds();
105
109
/** Returns the UNIX epoch seconds component. */
106
110
inline time_t epoch_seconds() const {return _epoch_seconds;}
111
/** Sets the seconds component. */
112
inline void set_seconds(const uint32_t second) {_seconds= second;}
107
113
/** Returns the seconds component. */
108
114
inline uint32_t seconds() const {return _seconds;}
115
/** Sets the days component. */
116
inline void set_minutes(const uint32_t minute) {_minutes= minute;}
109
117
/** Returns the minutes component. */
110
118
inline uint32_t minutes() const {return _minutes;}
119
/** Sets the hours component. */
120
inline void set_hours(const uint32_t hour) {_hours= hour;}
111
121
/** Returns the hours component. */
112
122
inline uint32_t hours() const {return _hours;}
113
123
/** Sets the days component. */
124
134
inline uint32_t years() const {return _years;}
126
136
/** Returns whether the temporal value is valid as a date. */
127
virtual inline bool is_valid_date() const= 0;
137
virtual bool is_valid_date() const= 0;
128
138
/** Returns whether the temporal value is valid as a datetime. */
129
virtual inline bool is_valid_datetime() const= 0;
139
virtual bool is_valid_datetime() const= 0;
130
140
/** Returns whether the temporal value is valid as a time. */
131
virtual inline bool is_valid_time() const= 0;
141
virtual bool is_valid_time() const= 0;
132
142
/** Returns whether the temporal value is valid as a UNIX timestamp. */
133
virtual inline bool is_valid_timestamp() const= 0;
143
virtual bool is_valid_timestamp() const= 0;
136
146
* Returns whether the temporal
218
228
class Date: public Temporal
221
inline bool is_valid_date() const {return is_valid();}
222
inline bool is_valid_datetime() const {return is_valid();}
223
inline bool is_valid_time() const {return false;}
224
inline bool is_valid_timestamp() const {return is_valid() && in_unix_epoch();}
231
virtual bool is_valid_date() const {return is_valid();}
232
virtual bool is_valid_datetime() const {return is_valid();}
233
virtual bool is_valid_time() const {return false;}
234
virtual bool is_valid_timestamp() const {return is_valid() && in_unix_epoch();}
225
235
/** Returns whether the temporal value is valid date. */
226
236
virtual bool is_valid() const;
227
237
/* Returns whether the Date (or subclass) instance is in the Unix Epoch. */
399
409
class Time: public Temporal
402
inline bool is_valid_date() const {return false;}
403
inline bool is_valid_datetime() const {return false;}
404
inline bool is_valid_time() const {return is_valid();}
405
inline bool is_valid_timestamp() const {return false;}
412
virtual bool is_valid_date() const {return false;}
413
virtual bool is_valid_datetime() const {return false;}
414
virtual bool is_valid_time() const {return is_valid();}
415
virtual bool is_valid_timestamp() const {return false;}
406
416
/** Returns whether the temporal value is valid date. */
407
417
virtual bool is_valid() const;