# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# second

Seconds of date or time

## Syntax

``Seconds = second(Date)``
``Seconds = second(___,F)``

## Description

example

````Seconds = second(Date)` returns the seconds given a serial date number or a date character vector.```

example

````Seconds = second(___,F)` returns the second of one or more date character vectors, `Date`, using format defined by the optional input `F`. `Date` can be a character array where each row corresponds to one date character vector, or a one-dimensional cell array of character vectors. All the character vectors in `Date` must have the same format `F`. `F` must designate a supported date format symbol. For more information on supported date formats, see `datestr`.```

## Examples

collapse all

Find the seconds of the day (`Date`) using a serial date number.

`Seconds = second(738647.558427893)`
```Seconds = 8.1700 ```

Find the seconds of the day (`Date`) using a date character vector format.

`Seconds = second('06-May-2022, 13:24:08.17')`
```Seconds = 8.1700 ```

## Input Arguments

collapse all

Date to determine second, specified as a serial date number or date character vector.

`Date` can be an array of date character vectors, where each row corresponds to one date character vector, or a one-dimensional cell array of character vectors. All the character vectors in `Date` must have the same format `F`. `F` must designate a supported date format symbol. For more information on supported date formats, see `datestr`

Data Types: `single` | `double` | `char` | `cell`

Date format symbol, specified as a character vector to designate the date format symbol for input argument `Date`. For more information on supported date character vector formats, see `datestr`. Note, formats with `'Q'` are not accepted.

Data Types: `char`

## Output Arguments

collapse all

Seconds of date or time, returned as a serial date number or date character vector.