Moment.js get day name from date

With moment you can parse the date string you have:

var dt = moment(myDate.date, "YYYY-MM-DD HH:mm:ss")

That’s for UTC, you’ll have to convert the time zone from that point if you so desire.

Then you can get the day of the week:

dt.format('dddd');

And you can get the 3 letter format weekday by

dt.format('dddd').substring(0,3)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)