We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Time Zone Offset not sent to server

Thread ID:

Created:

Updated:

Platform:

Replies:

130156 Apr 25,2017 05:16 PM UTC May 5,2017 04:19 AM UTC ASP.NET MVC 1
loading
Tags: DateTimePicker
Paul Schaeflein
Asked On April 25, 2017 05:16 PM UTC

When the DateTimePicker control is used, the selected date and time are sent to the server without time zone information. For example,

Schedule.StartDate=4%2F25%2F2017+2%3A00+PM

How should the control be used to instruct it to send the time zone offset of the browser as part of the form data?

Sasikala Nagarajan [Syncfusion]
Replied On May 5, 2017 04:19 AM UTC

Hi Paul, 
Sorry for the delay, 
How should the control be used to instruct it to send the time zone offset of the browser as part of the form data? 
You can achieve your requirement by changing the date value before post to controller, 
Please refer the below code example, 

@Html.EJ().DateTimePicker("endDate").Value(Model.endDate) 
 
function changeValue(args) { 
        var dateValue = new Date($("#endDate").val()); 
        dateValue.setTime(dateValue.getTime() + dateValue.getTimezoneOffset() * 60 * 1000); 
        $("#endDate").val(dateValue); 
    } 

Here we have changed the value of DateTimePicker control value based on needs manually in submit button click event (in view's script section ). Also in model We have maintained the DateTimePicker value’s member(endDate) in models as string Data Type to achieve this solution. 

Please check with the given solution. If we misunderstood requirement or if still you are facing any issue,  please provide more information  which will help us to provide the exact solution. We will be happy to help you. 
  
Regards 
Sasikala Nagarajan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;