Skip to content

getSecond

The getSecond() function returns the seconds (0–59) of a TheDate, adjusted by an optional time zone.

Interactive example

Syntax

typescript
function getSecond<
	GenericInput extends TheDate | SerializedTheDate
>(
	input: GenericInput,
	timezone: Timezone = "UTC"
): number

Parameters

  • input: TheDate or SerializedTheDate.
  • timezone: IANA timezone. Default: "UTC".

Return value

Seconds between 0 and 59.

See also

Sources

Released under the MIT license.