To ensure consistency with time zones, it is recommended to convert time to UTC in the browser and handle everything in UTC (except for displaying to users). Send dates to the server in full ISO8601 format so that when parsed by the server, it can be converted to its local timezone:
// Ensure myDateTimeValue is a Date object in JavaScript
var utcDateTimeAsString = myDateTimeValue.toISOString();
You can either store this value in a hidden field to send to the server during a regular postback or include it as part of your AJAX request.
On the server side, parsing such strings will result in a valid local date corresponding to the same absolute time:
// Example C# parsing of JavaScript's (new Date()).toISOString() result
DateTime localTime = DateTime.Parse("2016-02-01T06:38:05.609Z");
If you choose to handle time zones manually, here are some helpful links:
- Convert local time to UTC in JavaScript - How do you convert a JavaScript date to UTC?
- Get timezone offset for server-side rendering - How to get UTC offset in JavaScript (similar to TimeZoneInfo.GetUtcOffset in C#)
- Convert UTC to local time in JavaScript - Convert UTC date time to local date time using JavaScript