Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/live/commons/jwt/deps.ts>djwt.getNumericDate

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
function djwt.getNumericDate
import { djwt } from "https://deno.land/x/live@1.75.5/commons/jwt/deps.ts";
const { getNumericDate } = djwt;

This helper function simplifies setting a NumericDate. It takes either a Date object or a number (in seconds) and returns the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time.

Parameters

exp: number | Date

Returns

number