New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

usedate

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usedate

Allows you to display the date in a nice format.

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
0
Created
Source

📅

useDate()

npm version npm downloads npm license

Install

npm i usedate

Usage

import useDate from "usedate";

OR

const useDate = require("usedate");

Formats & Examples

useDate("mn dd yyyy")

Output: Jun 02 2021

useDate("mn/dd/yyyy")

Output: Jun/02/2021

useDate("mn-dd-yyyy")

Output: Jun-02-2021

useDate("mm/dd/yyyy")

Output: 06/02/2021

useDate("m/dd/yyyy")

Output: 6/02/2021

useDate("m/d/yyyy")

Output: 6/2/2021

useDate("m/d/yy")

Output: 6/2/21

useDate("mn-dn-yyyy")

Output: Jun-Wednesday-2021

useDate("mn/dd/yy")

Output: Jun/02/21

useDate("dn, mn dd yyyy")

Output: Wednesday, Jun 02 2021

useDate("dn, m/d/yy")

Output: Wednesday, 6/2/21

useDate("yyyy-mm-dd")

Output: 2021-06-02

useDate("yy/mm/dd")

Output: 21/06/02

useDate("fmn dd yyyy")

Output: June 02 2021

useDate("fmn, fdn do yyyy")

Output: Wednesday, June 2nd 2021

useDate("fdn, fmn dd yyyy")

Output: Wednesday, June 02 2021

useDate("fdn, fmn do yyyy")

Output: Wednesday, June 2nd 2021

useDate("fdn, m/d/yyyy")

Output: Wednesday, 6/2/2021

useDate("fdn, fmn dd, yyyy")

Output: Wednesday, June 02, 2021

Default (useDate())

Output: 6/2/2021

Invalid Input (useDate(123))

Output: Error: "Invalid Format"

Keywords

usedate

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts