Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/postgres/deps.ts>date.difference

PostgreSQL driver for Deno
Go to Latest
function date.difference
import { date } from "https://deno.land/x/postgres@ls/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"] })