JavaScript
  • JavascriptF1
  • docs
    • Dates
    • Fullscreen
    • Random
Powered by GitBook
On this page
  • today
  • todayAsIsoString
  • yesterday
  • yesterdayAsIsoString
  • tomorrow
  • tomorrowAsIsoString

Was this helpful?

  1. docs

Dates

PreviousdocsNextFullscreen

Last updated 3 years ago

Was this helpful?

Date and time related utility functions.


today

Returns the actual date as a Date object.

Syntax:

today() : Date

Parameters: None

Returns: Date

Example:

import * as Dates from "./utils/Dates.js";

let today = Dates.today();

todayAsIsoString

Returns today's date as string formatted in the ISO format: 2020-11-27.

Syntax:

todayAsIsoString() : string

Parameters: None

Returns: String

Example:

import * as Dates from "./utils/Dates.js";

let today = Dates.todayAsIsoString();

yesterday

Syntax:

yesterday() : Date

Parameters: None

Returns: Date

Example:

import * as Dates from "./utils/Dates.js";

let yesterday = Dates.yesterday();

yesterdayAsIsoString

Syntax:

yesterdayAsIsoString() : string

Parameters: None

Returns: String

Example:

import * as Dates from "./utils/Dates.js";

let yesterday = Dates.yesterdayAsIsoString();

tomorrow

Syntax:

tomorrow() : Date

Parameters: None

Returns: Date

Example:

import * as Dates from "./utils/Dates.js";

let tomorrow = Dates.tomorrow();

tomorrowAsIsoString

Syntax:

tomorrowAsIsoString() : string

Parameters: None

Returns: String

Example:

import * as Dates from "./utils/Dates.js";

let tomorrow = Dates.tomorrowAsIsoString();

Returns yesterday's date as a Date object.

Returns yesterday's date as a string formatted in ISO format. 2020-11-27.

Returns tomorrow's date as a Date object.

Returns tomorrow's date as a string formatted in ISO format. 2020-11-27.

Source
Source
Source
Source
Source
Source