import { isUtcLeap } from "https://deno.land/std@0.224.0/datetime/mod.ts";
Returns whether the given year is a leap year in UTC time. This always returns the same value regardless of the local timezone.
This is based on https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year.
Examples
Basic usage
Basic usage
import { isUtcLeap } from "https://deno.land/std@0.224.0/datetime/is_leap.ts";
isUtcLeap(new Date("2000-01-01")); // true
isUtcLeap(new Date("December 31, 1999 23:59:59 GMT-01:00")); // true
isUtcLeap(2000); // true
isUtcLeap(1999); // false
Parameters
year: Date | number
The year in number or Date
format.