26 #if defined (HAVE_CONFIG_H)
37 #if defined (OCTAVE_USE_WINDOWS_API)
56 : m_ot_unix_time (static_cast<OCTAVE_TIME_T> (
d)), m_ot_usec (0)
59 m_ot_usec =
static_cast<int> (std::modf (
d, &ip) * 1e6);
63 : m_ot_unix_time (), m_ot_usec ()
69 t.tm_hour = tm.
hour ();
70 t.tm_mday = tm.
mday ();
72 t.tm_year = tm.
year ();
73 t.tm_wday = tm.
wday ();
74 t.tm_yday = tm.
yday ();
75 t.tm_isdst = tm.
isdst ();
77 #if defined (HAVE_TM_GMTOFF)
78 t.tm_gmtoff = tm.
gmtoff ();
81 #if defined (HAVE_STRUCT_TM_TM_ZONE)
82 std::string s = tm.
zone ();
83 char *ps =
strsave (s.c_str ());
89 #if defined (HAVE_STRUCT_TM_TM_ZONE)
108 << std::setw (6) << std::setfill (
'0') << ot.
m_ot_usec;
134 #define DEFINE_SET_FIELD_FCN(type, f, lo, hi) \
136 base_tm::f (type v) \
143 #define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \
144 DEFINE_SET_FIELD_FCN (int, f, lo, hi)
153 std::numeric_limitd<
int>::
max ())
166 #if ! defined STRFTIME_BUF_INITIAL_SIZE
167 # define STRFTIME_BUF_INITIAL_SIZE 128
189 #if defined (HAVE_TM_GMTOFF)
193 #if defined (HAVE_STRUCT_TM_TM_ZONE)
198 const char *fmt_str = fmt.c_str ();
202 std::size_t chars_written = 0;
204 while (chars_written == 0)
207 buf =
new char [bufsize];
216 #if defined (HAVE_STRUCT_TM_TM_ZONE)
234 struct ::tm *t =
static_cast<struct ::tm *
> (p);
246 #if defined (HAVE_TM_GMTOFF)
248 #elif defined (OCTAVE_USE_WINDOWS_API)
249 TIME_ZONE_INFORMATION tzi;
251 GetTimeZoneInformationForYear (
m_year,
nullptr, &tzi);
254 m_gmtoff = -60 * (tzi.Bias + tzi.DaylightBias);
256 m_gmtoff = -60 * (tzi.Bias + tzi.StandardBias);
259 #if defined (HAVE_STRUCT_TM_TM_ZONE)
262 #elif defined (OCTAVE_USE_WINDOWS_API)
267 #elif defined (HAVE_TZNAME)
268 if (t->tm_isdst == 0 || t->tm_isdst == 1)
269 m_zone = tzname[t->tm_isdst];
308 #if defined (HAVE_TM_GMTOFF)
312 #if defined (HAVE_STRUCT_TM_TM_ZONE)
317 const char *p = str.c_str ();
323 if (t.tm_mday != 0 && t.tm_mon >= 0
343 #if defined (HAVE_STRUCT_TM_TM_ZONE)
351 time_t usr_sec, sys_sec;
360 time_t usr_sec, sys_sec;
361 long usr_usec, sys_usec;
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
std::string asctime(void) const
OCTAVE_API void init(void *p)
std::string zone(void) const
OCTAVE_API std::string strftime(const std::string &fmt) const
OCTAVE_API void stamp(void)
OCTAVE_API void init(const time &ot)
OCTAVE_API void init(const time &ot)
OCTAVE_API void stamp(void)
OCTAVE_API void init(const std::string &str, const std::string &fmt)
OCTAVE_TIME_T unix_time(void) const
OCTAVE_API std::string ctime(void) const
OCTAVE_TIME_T m_ot_unix_time
OCTAVE_API void stamp(void)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
std::string u8_from_wstring(const std::wstring &wchar_string)
static char * strsave(const char *s)
#define DEFINE_SET_INT_FIELD_FCN(f, lo, hi)
#define STRFTIME_BUF_INITIAL_SIZE
std::ostream & operator<<(std::ostream &os, const time &ot)
#define DEFINE_SET_FIELD_FCN(type, f, lo, hi)
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)