81
rated 0 times
[
86]
[
5]
/ answers: 1 / hits: 5209
/ 4 Years ago, tue, january 28, 2020, 12:00:00
I am trying to convert the following set of strings:
juin 2016
septembre 2013
janvier 2013
juillet 2010
All of which are in French, so when I use new Date()
it defaults to January
:
new Date('juin 2016') // -> Fri Jan 01 2016 00:00:00
new Date('août 2013') // -> Tue Jan 01 2013 00:00:00
Whereas it should be:
new Date('juin 2016') // -> Wed Jun 01 2016 00:00:00
new Date('août 2013') // -> Thu Aug 01 2013 00:00:00
Is there a way for the months from other languages be recognized?
Or the only way is to manually translate the months into english?
More From » node.js