23 #if !defined (octave_oct_time_h)
24 #define octave_oct_time_h 1
40 : ot_unix_time (0), ot_usec (0) { stamp (); }
43 : ot_unix_time (t), ot_usec (0) { }
46 : ot_unix_time (t), ot_usec ()
53 extra = (us -
rem) / 1000000;
59 extra = - (1 + (us -
rem) / 1000000);
60 rem = 1000000 - us % 1000000;
64 ot_unix_time += extra;
68 : ot_unix_time (static_cast<time_t> (d)), ot_usec (0)
71 ot_usec =
static_cast<int> (std::modf (d, &ip) * 1e6);
77 : ot_unix_time (ot.ot_unix_time), ot_usec (ot.ot_usec) { }
94 double double_value (
void)
const {
return ot_unix_time + ot_usec / 1e6; }
96 time_t
unix_time (
void)
const {
return ot_unix_time; }
98 int usec (
void)
const {
return ot_usec; }
100 std::string ctime (
void)
const;
139 return (t1 < t2 || t1 == t2);
158 return (t1 > t2 || t1 == t2);
236 std::string
strftime (
const std::string& fmt)
const;
239 {
return strftime (
"%a %b %d %H:%M:%S %Y\n"); }
365 void init (
const std::string& str,
const std::string& fmt);
virtual ~octave_base_tm(void)
std::string asctime(void) const
bool operator>(const octave_time &t1, const octave_time &t2)
octave_time(time_t t, int us)
std::string strftime(const std::string &fmt) const
octave_base_tm(const octave_base_tm &tm)
std::string zone(void) const
bool operator==(const octave_time &t1, const octave_time &t2)
octave_localtime(const octave_time &ot)
int characters_converted(void) const
octave_time operator+(const octave_time &t1, const octave_time &t2)
bool operator<=(const octave_time &t1, const octave_time &t2)
double double_value(void) const
octave_strptime(const octave_strptime &s)
F77_RET_T const double const double double * d
bool operator!=(const octave_time &t1, const octave_time &t2)
octave_time(const octave_time &ot)
octave_localtime(const octave_localtime &t)
time_t unix_time(void) const
octave_strptime(const std::string &str, const std::string &fmt)
bool operator>=(const octave_time &t1, const octave_time &t2)
bool operator<(const octave_time &t1, const octave_time &t2)
octave_int< T > rem(const octave_int< T > &x, const octave_int< T > &y)
octave_base_tm & operator=(const octave_base_tm &tm)
octave_gmtime(const octave_time &ot)
charNDArray min(char d, const charNDArray &m)