Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/datetime/mod.ts>difference

Deno standard library
Go to Latest
function difference
import { difference } from "https://deno.land/std@0.74.0/datetime/mod.ts";

Calculate difference between two dates.

Parameters

from: Date

Year to calculate difference

to: Date

Year to calculate difference with

optional
options: DifferenceOptions

Options for determining how to respond

example :

datetime.difference(new Date("2020/1/1"),new Date("2020/2/2"),{ units : ["days","months"] })