Skip to content

isAfterUnix

isAfterUnix(value1: number, value2: number, options?: { epochUnit?: UnixUnit; }): boolean
import { isAfterUnix } from "@northguild/gmt/unix/compare";

Return whether value1 represents an instant strictly after value2.

  • Uses Temporal.Instant.compare to check ordering.
  • Returns false if either input is invalid.
Parameter Type Description
value1 number first unix epoch value
value2 number second unix epoch value

options

Option Type Default
epochUnit? UnixUnit

true if value1 is after value2, otherwise false

isAfterUnix(1706659200, 1704067200) // true
isAfterUnix(1706659200, 1706659200) // false
isAfterUnix(-1, 0) // false

unix/compare/isAfterUnix.ts