1.0.0 • Published 12 days ago

tinydateformat2 v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

tinydateformat2

Date formatting tool in less than 1kb

Install

npm install tinydateformat2 --save

Browsers

<script src="https://cdn.jsdelivr.net/npm/tinydateformat2/dist/tinydateformat.js"></script>

Usage

CommonJS

const tinydateformat2 = require('tinydateformat2')

ES Modules

import tinydateformat2 from 'tinydateformat2'
// default: 'HH:mm:ss' and Date.now()
tinydateformat2()
// => 14:26:04

tinydateformat2('DD/MM/YYYY')
// => 25/03/2023

tinydateformat2('YY/M/DD', '2023-1-10')
// => 23/1/10

tinydateformat2('YY/MM/DD', '2023-1-10')
// => 23/01/10
FormatOutputDescription
YY23Two-digit year
YYYY2023Four-digit year
M1-12The month, beginning at 1
MM01-12The month, 2-digits
MMMJan-DecThe abbreviated month name
MMMMJanuary-DecemberThe full month name
D1-31The day of the month
DD01-31The day of the month, 2-digits
d1-7The day of the week
H0-23The hour
HH00-23The hour, 2-digits
h1-12The hour, 12-hour clock
hh01-12The hour, 12-hour clock, 2-digits
m0-59The minute
mm00-59The minute, 2-digits
s0-59The second
ss00-59The second, 2-digits
1.0.0

12 days ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago