Guest User

Untitled

a guest
Oct 16th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. const uglyDate = '29–03–1989';
  2.  
  3. // parse the ugly date with a specific format
  4. const niceDate = moment(uglyDate, 'DD-MM-YYYY');
  5.  
  6. // format the date into our nice, custom format
  7. console.log(niceDate.format('ddd MMM Do, YYYY')); // Wed Mar 29th, 1989
Add Comment
Please, Sign In to add comment