datetime

Methods

Method Reference: datetime.second

datetime: s = second (T)
datetime: s = second (T, secondType)

Seconds component of a datetime array.

s = second (T) returns the number of seconds for each element of the input datetime array T. The output s is a double array containing values in the range [1, 60), including any fractional part of the second, and it has the same size as T. Not-A-Time (NaT) values in T are returned as NaN in the output array.

s = second (T, secondType) returns the seconds for each element of the input datetime array T as specified by secondType, which may have any of the following options:

  • 'secondofminute' (default) returns the second of the minute in a numeric array, in the range [1, 60).
  • 'secondofday' returns the second of the day in a numeric array, in the range [1, 86400).

Source Code: datetime