Skip to main content
Home
This release is 40 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.201.0)

Utilities for dealing with Date objects.

The following symbols from unicode LDML are supported:

  • yyyy - numeric year.

  • yy - 2-digit year.

  • M - numeric month.

  • MM - 2-digit month.

  • d - numeric day.

  • dd - 2-digit day.

  • H - numeric hour (0-23 hours).

  • HH - 2-digit hour (00-23 hours).

  • h - numeric hour (1-12 hours).

  • hh - 2-digit hour (01-12 hours).

  • m - numeric minute.

  • mm - 2-digit minute.

  • s - numeric second.

  • ss - 2-digit second.

  • S - 1-digit fractionalSecond.

  • SS - 2-digit fractionalSecond.

  • SSS - 3-digit fractionalSecond.

  • a - dayPeriod, either AM or PM.

  • 'foo' - quoted literal.

  • ./- - unquoted literal.

This module is browser compatible.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/datetime

Import symbol

import * as datetime from "@std/datetime";
or

Import directly with a jsr specifier

import * as datetime from "jsr:@std/datetime";

Add Package

pnpm i jsr:@std/datetime
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/datetime

Import symbol

import * as datetime from "@std/datetime";

Add Package

yarn add jsr:@std/datetime
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/datetime

Import symbol

import * as datetime from "@std/datetime";

Add Package

vlt install jsr:@std/datetime

Import symbol

import * as datetime from "@std/datetime";

Add Package

npx jsr add @std/datetime

Import symbol

import * as datetime from "@std/datetime";

Add Package

bunx jsr add @std/datetime

Import symbol

import * as datetime from "@std/datetime";