I'm pulling dates from a SQL database which treats them as dates that start at midnight. When I go to use toLocaleDateString()
on them, it formats them properly, however not before losing a day.
Before formatting: 2011-09-01T00:00:00
After formatting: 8/31/2011
Code:
plan.dateReceived = new Date(plan.dateReceived).toLocaleDateString()+','+plan.dateReceived;
Why does it do this, and what inline fix can I make to have it behave properly? I also found another post that had a similar problem, but I'm not 100% convinced that it's a timezone issue.