Last post Sep 28, 2014 04:09 AM by damienBod
Sep 28, 2014 01:15 AM|Alex71938|LINK
I ran into a weird issue - I am selecting 1st of September in datepicker.
console.log shows: Mon Sep 01 2014 00:00:00 GMT+1000 (AUS Eastern Standard Time)
But when I submit a $http.post , I see that I am sending "2014-08-31T14:00:00.000Z" to the server. So in the controller my date is treated as day before.
What is the correct way if I actually want to store 1st Sep in the database?
Sep 28, 2014 04:09 AM|damienBod|LINK
This is correct, the console log is shows the local time set on your operating system.
UTC time in this ISO format in the database is a good format. This time is always correct. You have not saved the local time from the operating system which set the timestamp. You usually don't need this. If you require this as well, use the DateTimeOffset
You should only use the local time of the operating system when displaying the data.