Home Unanswered Active Tags New Question

Client side date change UTC problem

Hi, I'm trying to change the DayPilot dates from the client side: JavaScript: DayPilotCal.ChangeDates(dateFirst,DaysSelect); C#: protected void DayPilotCalendar1_Refresh(object sender, RefreshEventArgs e) { DayPilotCalendar1.StartDate = e.StartDate; DayPilotCalendar1.Days = e.Days; DayPilotCalendar1.Update(data, CallBackUpdateType.Full); } I keep getting different dates in the server side: dateFirst = Sun Apr 19 12:00:00 UTC+0200 2009 e.StartDate = {19/04/2009 10:00:00} dateFirst = Sun Apr 5 00:00:00 UTC+0200 2009 e.StartDate = {04/04/2009 22:00:00} There is a 2 hours offset because of the UTC. How should I handle changing the DayPilot Dates from the JS? Thanks. Rafael
Asked by Rafael 2 years ago.
Replies

All the dates passed from the client side are evaluated using theit GMT value. You can also use DayPilot.Date instance instead (DayPilot.Date is a pure DateTime value without time zone offset information).

Comment posted by Dan Letecky 2 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java