import * as mod from "https://deno.land/std@0.221.0/datetime/mod.ts";
Utilities for dealing with Date
objects.
import {
dayOfYear,
format,
isLeap,
} from "https://deno.land/std@0.221.0/datetime/mod.ts";
const date = new Date("2020-07-10T03:24:00");
dayOfYear(date); // 192
format(date, "dd-MM-yyyy"); // "10-07-2020"
isLeap(date); // true
Variables
v DAY | The number of milliseconds in a day. |
v HOUR | The number of milliseconds in an hour. |
The number of milliseconds in a minute. | |
The number of milliseconds in a second. | |
v WEEK | The number of milliseconds in a week. |
Functions
Returns the number of the day in the year in the local time zone. | |
Returns the number of the day in the year in UTC time. | |
Calculates 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. | |
Formats a date to a string with the specified format. | |
Returns whether the given year is a leap year. Passing in a
| |
Returns whether the given year is a leap year in UTC time. This always returns the same value regardless of the local timezone. | |
Parses a date string using the specified format string. | |
Returns the ISO week number of the provided date (1-53). |
Interfaces
Options for |
Type Aliases
Return type for | |
Options for | |
T Unit | Duration units for |