function now
now(): number

Current date and time as a Unix timestamp.

Returns the current date and time as a Unix timestamp (seconds since the Unix epoch).

Examples

Example 1

import { assertEquals } from "jsr:@std/assert";

// Example: Get the current Unix timestamp
const currentTimestamp = now();
assertEquals(typeof currentTimestamp, 'number');
// Current timestamp should be positive
assertEquals(currentTimestamp > 0, true);

Return Type

number

The current Unix timestamp.

Usage

import now from "datatype/now.ts";