Mercurial > octave
diff src/DLD-FUNCTIONS/time.cc @ 3255:4d33b1e56bff
[project @ 1999-07-15 20:54:14 by jwe]
author | jwe |
---|---|
date | Thu, 15 Jul 1999 20:54:34 +0000 |
parents | 28d5f556b8cf |
children | 35a6d027772c |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/time.cc Thu Jul 15 16:02:57 1999 +0000 +++ b/src/DLD-FUNCTIONS/time.cc Thu Jul 15 20:54:34 1999 +0000 @@ -75,15 +75,20 @@ return tm; } -DEFUN_DLD (time, , , +DEFUN_DLD (time, args, , "time ()\n\ \n\ Return current time. On Unix systems, this is the number of\n\ seconds since the epoch.") { - octave_time now; + octave_value retval; - return now.as_double (); + if (args.length () == 0) + retval = static_cast<double> (octave_time ()); + else + print_usage ("time"); + + return retval; } DEFUN_DLD (gmtime, args, , @@ -155,11 +160,7 @@ octave_base_tm tm = extract_tm (map); if (! error_state) - { - octave_time ot (tm); - - retval = ot.as_double (); - } + retval = static_cast<double> (octave_time (tm)); else error ("mktime: invalid TMSTRUCT argument"); } @@ -249,7 +250,7 @@ octave_base_tm tm = extract_tm (map); if (! error_state) - retval = tm.format_as_string (fmt); + retval = tm.strftime (fmt); else error ("strftime: invalid TMSTRUCT argument"); }