I want to get the date and time in GNU Octave and print it to screen. What is the best way to do this?
I’ve checked the Octave documentation, but I don’t see a function to print out YYYY-MM-DD HH:MM:SS with a one liner simple command.
http://www.gnu.org/software/octave/doc/interpreter/Timing-Utilities.html
Get the date and time in Octave:
Number of seconds since epoch as integer:
The
date(),now()anddatestr(...)builtin methods:Add/Subtract days/months interval from now:
Format date/time as string with
strftimeGet yyyy-mm-dd hh:mm:ss format
Sources:
https://octave.sourceforge.io/octave/function/datestr.html
https://octave.sourceforge.io/octave/function/strftime.html