Categories &

Functions List

Function Reference: seconds

datatypes: D = seconds (X)

Fixed-time duration in seconds.

D = seconds (X) returns a duration array representing fixed-time duration seconds equivalent to the values in X, which must be a numeric array.

seconds is also available as a method for duration arrays, in which case it performs the opposite conversion.

See also: duration, years, days, hours, minutes, milliseconds, duration.seconds

Source Code: seconds

Example: 1

seconds builds a fixed-length duration from a number of seconds — one of the builders (seconds, minutes, hours, days, years, milliseconds) you add together to make longer spans.

 seconds (90)
ans =
  duration

   90 sec

A numeric array builds one duration per element.

 seconds ([30, 60, 90])
ans =
  1x3 duration array

    30 sec    60 sec    90 sec