Skip to main content
Module

x/lume_langdata/deps.ts>date.difference

A Lume plugin for multi-language websites.
Latest
function date.difference
import { date } from "https://deno.land/x/lume_langdata@v2.0.6/deps.ts";
const { difference } = date;

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 :

import * as datetime from "https://deno.land/std@0.224.0/datetime/mod.ts";

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