Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Date test
node v10.24.1
version:
0.0.1
endpoint
share
tweet
var format = require('date-fns/format') var parse = require('date-fns/parse') const timestamp = '1908-09-15T23:59:59.000Z'; console.log('Initial data - ' + timestamp); const parsedDate = parse(timestamp, 'YYYY-MM-DD'); console.log('Parsed to - '); console.dir(parsedDate); const formatedDate = format(parsedDate, 'YYYY-MM-DD'); console.log('Formated to - '); console.dir(formatedDate);
Created from: https://npm.runkit.com/npm
Loading…
no comments
sign in
to comment