In my Java Script app I have the date stored in a format like so:
2011-09-24
Now when I try using the above value to create a new Date obje
You are using the ISO date string format which, according to this page, causes the date to be constructed using the UTC timezone:
Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.
If you format the text differently, such as "Jan 01 1970"
, then (at least on my machine) it uses your local timezone.