0.0.3 • Published 5 years ago

tecdateform v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

tecdateform

Installation

npm i --save tecdateform

USAGE

const tec = require('tecdateform');

var date = new Date();

console.log( tec.formatDate(date , 'dd.mm.yyyy') );
____________________________________________

Output in console:

21.06.2019

Options

d       No leading zero for single-digit days
dd      Leading zero for single-digit days
ddd     Day of the week as a three-letter abbreviation
dddd    Day of the week as its full name
m       No leading zero for single-digit months
mm      Leading zero for single-digit months
mmm     Month as a three-letter abbreviation
mmmm    Month as its full name
yy      Year as last two digits
yyyy    Year represented by four digits
h       No leading zero for single-digit hours (12-hour)
hh      Leading zero for single-digit hours (12-hour)
H       No leading zero for single-digit hours (24-hour)
HH      Leading zero for single-digit hours (24-hour)
M       No leading zero for single-digit minutes
MM      Leading zero for single-digit minutes
s       No leading zero for single-digit seconds
ss      Leading zero for single-digit seconds
lll     Miliseconds with three digits
ll      Miliseconds with two digits
tt      Lowercase am/pm
TT      Uppercase AM/PM


Example: mm/dd/yyyy - HH:MM:ss.l -> 06/16/2019 - 21:55:11.730

Changes

  • 07/17/2019 - Fixed Problems
  • First implementation

Upcoming