Skip to content

maxUnix

maxUnix(unixValues: number[]): number
import { maxUnix } from "@northguild/gmt/unix/calculate";

Return the latest (maximum) of the given Unix timestamp values.

  • Filters invalid values before finding maximum.
  • Returns null if array is empty or has no valid values.
Parameter Type Description
unixValues number[] Array of Unix timestamps (e.g. 1699531200)

The latest Unix timestamp, or null on invalid input

maxUnix([1706659200000, 1704067200000, 1700000000000]) // 1706659200000
maxUnix([]) // null

unix/calculate/maxUnix.ts