26 #if defined (HAVE_CONFIG_H)
51 : ot_unix_time (static_cast<time_t> (
d)), ot_usec (0)
54 ot_usec =
static_cast<int> (std::modf (
d, &ip) * 1e6);
58 : ot_unix_time (), ot_usec ()
64 t.tm_hour = tm.
hour ();
65 t.tm_mday = tm.
mday ();
67 t.tm_year = tm.
year ();
68 t.tm_wday = tm.
wday ();
69 t.tm_yday = tm.
yday ();
70 t.tm_isdst = tm.
isdst ();
72 #if defined (HAVE_TM_GMTOFF)
73 t.tm_gmtoff = tm.
gmtoff ();
76 #if defined (HAVE_STRUCT_TM_TM_ZONE)
77 std::string s = tm.
zone ();
78 char *ps =
strsave (s.c_str ());
84 #if defined (HAVE_STRUCT_TM_TM_ZONE)
103 << std::setw (6) << std::setfill (
'0') << ot.
ot_usec;
127 #define DEFINE_SET_FIELD_FCN(type, f, lo, hi) \
129 base_tm::f (type v) \
136 #define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \
137 DEFINE_SET_FIELD_FCN (int, f, lo, hi)
146 std::numeric_limitd<
int>::
max ())
159 #if ! defined STRFTIME_BUF_INITIAL_SIZE
160 # define STRFTIME_BUF_INITIAL_SIZE 128
182 #if defined (HAVE_TM_GMTOFF)
186 #if defined (HAVE_STRUCT_TM_TM_ZONE)
191 const char *fmt_str = fmt.c_str ();
195 size_t chars_written = 0;
197 while (chars_written == 0)
200 buf =
new char [bufsize];
209 #if defined (HAVE_STRUCT_TM_TM_ZONE)
227 struct ::tm *t =
static_cast<struct ::tm *
> (p);
239 #if defined (HAVE_TM_GMTOFF)
243 #if defined (HAVE_STRUCT_TM_TM_ZONE)
246 #elif defined (HAVE_TZNAME)
247 if (t->tm_isdst == 0 || t->tm_isdst == 1)
248 m_zone = tzname[t->tm_isdst];
287 #if defined (HAVE_TM_GMTOFF)
291 #if defined (HAVE_STRUCT_TM_TM_ZONE)
296 const char *p = str.c_str ();
302 if (t.tm_mday != 0 && t.tm_mon >= 0
322 #if defined (HAVE_STRUCT_TM_TM_ZONE)
336 time_t usr_sec, sys_sec;
337 long usr_usec, sys_usec;
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
std::string zone(void) const
std::string strftime(const std::string &fmt) const
std::string asctime(void) const
void init(const time &ot)
void init(const time &ot)
void init(const std::string &str, const std::string &fmt)
std::string ctime(void) const
time_t unix_time(void) const
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
static char * strsave(const char *s)
std::ostream & operator<<(std::ostream &os, const time &ot)
#define DEFINE_SET_INT_FIELD_FCN(f, lo, hi)
#define STRFTIME_BUF_INITIAL_SIZE
#define DEFINE_SET_FIELD_FCN(type, f, lo, hi)
octave_value::octave_value(const Array< char > &chm, char type) return retval
size_t octave_strftime_wrapper(char *buf, size_t len, const char *fmt, const struct tm *t)
char * octave_strptime_wrapper(const char *p, const char *fmt, struct tm *t)
int octave_cpu_time(time_t *usr_sec, time_t *sys_sec, long *usr_usec, long *sys_usec)
int octave_gettimeofday_wrapper(time_t *sec, long *usec)
time_t octave_mktime_wrapper(struct tm *tp)
int octave_getrusage_wrapper(time_t *usr_sec, time_t *sys_sec, long *usr_usec, long *sys_usec, long *maxrss, long *ixrss, long *idrss, long *isrss, long *minflt, long *majflt, long *nswap, long *inblock, long *oublock, long *msgsnd, long *msgrcv, long *nsignals, long *nvcsw, long *nivcsw)