Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const uglyDate = '29–03–1989';
- // parse the ugly date with a specific format
- const niceDate = moment(uglyDate, 'DD-MM-YYYY');
- // format the date into our nice, custom format
- console.log(niceDate.format('ddd MMM Do, YYYY')); // Wed Mar 29th, 1989
Add Comment
Please, Sign In to add comment