date-to-yyyymmdd
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Date to YYMMDD type string

As the title says.

This is a fork of yymmdd

This package on npm had no github repo so I basically didn't trust it.

sample

If the system time is 2020-01-02 03:04:15

import { yyyymmdd, yyyymmddhhmmss, yyyy_mm_dd, yyyy_mm_dd_hh_mm_ss } from "yymmdd";
yyyymmdd(); // 20200102
yyyymmdd(new Date("2020/01/05")); // 20200105
yyyymmddhhmmss(); // 20200102030415
yyyymmddhhmmss(new Date("2020/01/05 12:13:14")); // 20200105121314

yyyy_mm_dd(); // 2020-01-02
yyyy_mm_dd(new Date("2020/01/05")); // 2020-01-05
yyyy_mm_dd_hh_mm_ss(); // 2020-01-02 03:04:15
yyyy_mm_dd_hh_mm_ss(new Date("2020/01/05 12:13:14")); // 2020-01-05 12:13:14

Readme

Keywords

Package Sidebar

Install

npm i date-to-yyyymmdd

Weekly Downloads

1

Version

1.0.3

License

none

Unpacked Size

12 kB

Total Files

13

Last publish

Collaborators

  • carmichael.john