26 #if defined (HAVE_CONFIG_H)
46 m.assign (
"usec",
static_cast<double> (t.
usec ()));
47 m.assign (
"sec",
static_cast<double> (t.
sec ()));
48 m.assign (
"min",
static_cast<double> (t.
min ()));
49 m.assign (
"hour",
static_cast<double> (t.
hour ()));
50 m.assign (
"mday",
static_cast<double> (t.
mday ()));
51 m.assign (
"mon",
static_cast<double> (t.
mon ()));
52 m.assign (
"year",
static_cast<double> (t.
year ()));
53 m.assign (
"wday",
static_cast<double> (t.
wday ()));
54 m.assign (
"yday",
static_cast<double> (t.
yday ()));
55 m.assign (
"isdst",
static_cast<double> (t.
isdst ()));
56 m.assign (
"gmtoff",
static_cast<double> (t.
gmtoff ()));
57 m.assign (
"zone", t.
zone ());
75 static inline std::string
120 if (args.length () != 0)
132 DEFUN (gmtime, args, ,
162 if (args.length () != 1 || args(0).
numel () != 1)
165 double tmp = args(0).double_value ();
189 DEFUN (localtime, args, ,
217 if (args.length () != 1 || args(0).
numel () != 1)
220 double tmp = args(0).double_value ();
244 DEFUN (mktime, args, ,
261 if (args.length () != 1)
264 octave_scalar_map map = args(0).xscalar_map_value (
"mktime: TM_STRUCT argument must be a structure");
288 DEFUN (strftime, args, ,
446 if (args.length () != 2)
449 std::string fmt = args(0).xstring_value (
"strftime: FMT must be a string");
451 octave_scalar_map map = args(1).xscalar_map_value (
"strftime: TM_STRUCT must be a structure");
471 DEFUN (strptime, args, ,
483 if (args.length () != 2)
486 std::string str = args(0).xstring_value (
"strptime: argument STR must be a string");
488 std::string fmt = args(1).xstring_value (
"strptime: FMT must be a string");
std::string zone(void) const
std::string strftime(const std::string &fmt) const
int characters_converted(void) const
int xint_value(const char *fmt,...) const
std::string xstring_value(const char *fmt,...) const
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
T::size_type numel(const T &str)
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
static std::string stringfield(const octave_scalar_map &m, const std::string &k, const char *who)
static octave_scalar_map mk_tm_map(const octave::sys::base_tm &t)
static int intfield(const octave_scalar_map &m, const std::string &k, const char *who)
static octave::sys::base_tm extract_tm(const octave_scalar_map &m, const char *who)