Skip to main content
Home
This release is 30 versions behind 0.225.6 — the latest version of @std/datetime. Jump to latest

UNSTABLE: Utilities for dealing with Date objects

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 years ago (0.211.0)
Package root>constants.ts
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. /** * The number of milliseconds in a second. * * @example * ```ts * import { SECOND } from "@std/datetime/constants"; * * console.log(SECOND); // => 1000 * ``` */ export const SECOND = 1e3; /** * The number of milliseconds in a minute. * * @example * ```ts * import { MINUTE } from "@std/datetime/constants"; * * console.log(MINUTE); // => 60000 (60 * 1000) * ``` */ export const MINUTE: number = SECOND * 60; /** * The number of milliseconds in an hour. * * @example * ```ts * import { HOUR } from "@std/datetime/constants"; * * console.log(HOUR); // => 3600000 (60 * 60 * 1000) * ``` */ export const HOUR: number = MINUTE * 60; /** * The number of milliseconds in a day. * * @example * ```ts * import { DAY } from "@std/datetime/constants"; * * console.log(DAY); // => 86400000 (24 * 60 * 60 * 1000) * ``` */ export const DAY: number = HOUR * 24; /** * The number of milliseconds in a week. * * @example * ```ts * import { WEEK } from "@std/datetime/constants"; * * console.log(WEEK); // => 604800000 (7 * 24 * 60 * 60 * 1000) * ``` */ export const WEEK: number = DAY * 7;