Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
See the recommended documentation of this function
get date and time information
dt=getdate() x=getdate("s") dt=getdate(x)
an integer vector with 10 entries (see below)
an integer containing a date coded in second from 1 Jan 1970
returns the current date in format given below:
The year as a number (with the century) between 0000 and 9999.
The month of the year as a number between 01 and 12.
The ISO 8601 week number as a number between 01 and 53.
The Julian day of the year as a number between 001 and 366.
Specifies the weekday as a decimal number [1,7], with 1 representing Sunday.
The day of the month as a number between 01 and 31.
The hour of the day is output as a number between 00 and 23.
The minute is output as a number between 00 and 59.
The second is output as a number between 00 and 59.
The millisecond is output as a number between 000 and 999.
returns a scalar with the number of seconds since Jan 1, 1970, 00:00 UTC (Unix Time Convention)
Please note that the return value contains the leap seconds.
formats the date given by x (number of seconds since Jan 1, 1970, 00:00 UTC) in format given above. In this case dt(10) is always equal to 0.
getdate(0)will return Jan 1, 1970, 00:00 if the time zone concerned is UTC, but if the time zone is UTC+1, hour returned will be 01:00.
w=getdate() mprintf("Year:%d,Month:%d,Day:%d",w(1),w(2),w(6)); x=getdate("s") getdate(x)
|Report an issue|
|<< etime||Time and Date||now >>|