23 #if defined (HAVE_CONFIG_H) 43 m.
assign (
"usec", static_cast<double> (
t.usec ()));
44 m.
assign (
"sec", static_cast<double> (
t.sec ()));
45 m.
assign (
"min", static_cast<double> (
t.min ()));
46 m.
assign (
"hour", static_cast<double> (
t.hour ()));
47 m.
assign (
"mday", static_cast<double> (
t.mday ()));
48 m.
assign (
"mon", static_cast<double> (
t.mon ()));
49 m.
assign (
"year", static_cast<double> (
t.year ()));
50 m.
assign (
"wday", static_cast<double> (
t.wday ()));
51 m.
assign (
"yday", static_cast<double> (
t.yday ()));
52 m.
assign (
"isdst", static_cast<double> (
t.isdst ()));
53 m.
assign (
"gmtoff", static_cast<double> (
t.gmtoff ()));
117 if (args.length () != 0)
129 DEFUN (gmtime, args, ,
159 if (args.length () != 1)
162 double tmp = args(0).double_value ();
186 DEFUN (localtime, args, ,
214 if (args.length () != 1)
217 double tmp = args(0).double_value ();
241 DEFUN (mktime, args, ,
258 if (args.length () != 1)
261 octave_scalar_map map = args(0).xscalar_map_value (
"mktime: TM_STRUCT argument must be a structure");
285 DEFUN (strftime, args, ,
443 if (args.length () != 2)
446 std::string fmt = args(0).xstring_value (
"strftime: FMT must be a string");
468 DEFUN (strptime, args, ,
480 if (args.length () != 2)
483 std::string str = args(0).xstring_value (
"strptime: argument STR must be a string");
485 std::string fmt = args(1).xstring_value (
"strptime: FMT must be a string");
OCTINTERP_API void print_usage(void)
std::string xstring_value(const char *fmt,...) const
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
int xint_value(const char *fmt,...) const
std::string strftime(const std::string &fmt) const
std::string zone(void) const
static octave::sys::base_tm extract_tm(const octave_scalar_map &m, const char *who)
static int intfield(const octave_scalar_map &m, const std::string &k, const char *who)
octave_value getfield(const std::string &key) const
static octave_scalar_map mk_tm_map(const octave::sys::base_tm &t)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
void assign(const std::string &k, const octave_value &val)
static std::string stringfield(const octave_scalar_map &m, const std::string &k, const char *who)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string