Skip to content

unix/calculate

  • The core functions, which every industry uses.
  • addUnix: Add a temporal amount to a Unix epoch value and return the resulting epoch.
  • diffUnix: Return the difference between two Unix timestamps measured in the given unit.
  • diffUnixAsDuration: Return the difference between two Unix timestamps as an ISO 8601 duration string, bridging to the duration namespace (see parseDuration, normalizeDuration).
  • endOfQuarterForUnix: Return the end of the quarter for a Unix timestamp.
  • endOfUnix: Return the end of the specified unit for a Unix timestamp.
  • isBetweenUnix: Return true when the Unix timestamp is between start and end (inclusive by default).
  • maxUnix: Return the latest (maximum) of the given Unix timestamp values.
  • minUnix: Return the earliest (minimum) of the given Unix timestamp values.
  • roundUnix: Round a Unix timestamp to the specified unit.
  • secondsUntilUnix: Return the whole seconds from now until a stored Unix epoch, such as a JWT exp.
  • setUnix: Return a Unix epoch value with the given fields set on value, interpreted in timeZone.
  • sortUnix: Sort an array of Unix timestamp values in ascending or descending order.
  • startOfQuarterForUnix: Return the start of the quarter for a Unix timestamp.
  • startOfUnix: Return the start of the specified unit for a Unix timestamp.
  • subtractUnix: Subtract a temporal amount from a Unix epoch value and return the resulting epoch.

Last updated:

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.