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

default

Utilities for dealing with Date objects.

v
DAY

The number of milliseconds in a day.

f
dayOfYear

Returns the number of the day in the year in the local time zone.

f
dayOfYearUtc

Returns the number of the day in the year in UTC time.

f
difference

Returns the difference of the 2 given dates in the given units. If the units are omitted, it returns the difference in the all available units.

T
DifferenceFormat
No documentation available
T
DifferenceOptions
No documentation available
f
format

Takes an input date and a formatString to format to a string.

v
HOUR

The number of milliseconds in an hour.

f
isLeap

Returns whether the given date or year (in number) is a leap year or not in the local time zone. based on: https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year

f
isUtcLeap

Returns whether the given date or year (in number) is a leap year or not in UTC time. This always returns the same value regardless of the local timezone. based on: https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year

v
MINUTE

The number of milliseconds in a minute.

f
parse

Takes an input string and a formatString to parse to a date.

v
SECOND

The number of milliseconds in a second.

T
Unit
No documentation available
v
WEEK

The number of milliseconds in a week.

f
weekOfYear

Returns the ISO week number of the provided date (1-53).

f
toIMF
No documentation available
v
DAY

The number of milliseconds in a day.

v
HOUR

The number of milliseconds in an hour.

v
MINUTE

The number of milliseconds in a minute.

v
SECOND

The number of milliseconds in a second.

v
WEEK

The number of milliseconds in a week.

f
dayOfYear

Returns the number of the day in the year in the local time zone.

f
dayOfYearUtc

Returns the number of the day in the year in UTC time.

f
difference

Returns the difference of the 2 given dates in the given units. If the units are omitted, it returns the difference in the all available units.

T
DifferenceFormat
No documentation available
T
DifferenceOptions
No documentation available
T
Unit
No documentation available
f
format

Takes an input date and a formatString to format to a string.

f
isLeap

Returns whether the given date or year (in number) is a leap year or not in the local time zone. based on: https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year

f
isUtcLeap

Returns whether the given date or year (in number) is a leap year or not in UTC time. This always returns the same value regardless of the local timezone. based on: https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year

f
parse

Takes an input string and a formatString to parse to a date.

f
toIMF
No documentation available
f
weekOfYear

Returns the ISO week number of the provided date (1-53).

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.