I have date as 2017-11-01
. I want to display it in November 1, 2017
pattern.
What is the best and short approach to achieve it.
Asked
Active
Viewed 786 times
-1

Hassan Imam
- 21,956
- 5
- 41
- 51

Divya
- 107
- 1
- 1
- 7
-
please share and show us what you have tried. – brk Nov 03 '17 at 03:14
-
let try [momentjs](https://momentjs.com/), it solve everything about datetime :)! – Kai Nov 03 '17 at 03:17
-
Try this `var date = new Date("2017-11-01"), month = date.toLocaleString('en-us', { month: "long" }), formattedDate = month + ' ' + date.getDate() +', ' + date.getFullYear();` – Hassan Imam Nov 03 '17 at 03:22
-
@HassanImam—note that 2017-11-01 will most likely be parsed as UTC, but you are getting local values based on the host timezone offset, so the result may appear to be ±1 day. – RobG Nov 03 '17 at 03:29
-
See [*Convert date format in Javascript using VueJS*](https://stackoverflow.com/questions/46708110/convert-date-format-in-javascript-using-vuejs). There is also [*Where can I find documentation on formatting a date in JavaScript?*](https://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript) – RobG Nov 03 '17 at 03:32
-
@RobG Forgot to add that bit. Thanks for the clarification. – Hassan Imam Nov 03 '17 at 03:42
1 Answers
0
You should dig in SO. Its clearly answered question. in here
1st. You can use library as mention above Moment.Js is only 5.5kb minified so its cool to use
2nd.If you dont want use library just go see this answer

Munkhdelger Tumenbayar
- 1,734
- 18
- 26
-
1If it's a duplicate, mark it as a duplicate. But the OP doesn't have a Date, they have a string. – RobG Nov 03 '17 at 03:28