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);