JavaScript date objects UK dates

The JavaScript Date constructor doesn’t parse strings in that form (whether in UK or U.S. format). See the spec for details, but you can construct the dates part by part:

new Date(year, month, day);

MomentJS might be useful for dealing with dates flexibly. (This answer previously linked to this lib, but it’s not been maintained in a long time.)

Leave a Comment