This is a migrated thread and some comments may be shown as answers.

Offsetvalue causes incorrect backend data (SQLServer)

5 Answers 45 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 18 Jul 2008, 02:00 AM

When setting an offsetvalue our on-line calendar performs correctly but the backend data (SQLServer) is incorrect.  If offsetvalue is -07:00:00 all appoitments in our database will be off by 07:00:00 hours.

Setting SelectedDate:
      Dim start As DateTime = DateTime.UtcNow.[Date]
      RadScheduler1.SelectedDate = start

Setting offsetvalue
      RadScheduler1.TimeZoneOffset = TimeSpan.Parse(offsetvalue)

Am I setting the SelectedDate incorrectly? 

Thanks in advance

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Jul 2008, 01:48 PM
Hi Michael,

Thank you for conctacting us.

For the described scenario, you should send dates in UTC format to the database.

Hope this helps.

All the best,
Yana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Marc
Top achievements
Rank 1
answered on 18 Jul 2008, 10:23 PM
Thanks for the reply. 

Could you expand on "send dates in UTC format to the database"?
Is this a database change or back-end code?
0
Yana
Telerik team
answered on 21 Jul 2008, 12:42 PM
Hello Marc,

If you want your appointments to be saved in database in the way you send them, you should set  TimeZoneOffset  to 0.

Hope this helps.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Marc
Top achievements
Rank 1
answered on 22 Jul 2008, 06:30 AM
Thanks for the response Yana. 

Yes, setting my offsetvalue to 0 does give me correct database values.  But the on-line calendar ends up being off.

The end result I am looking for is:
Calendar Reads -7:00:00 (PST-US)
Database Entry Reads -7:00:00 (PST-US)

thanks
0
Yana
Telerik team
answered on 23 Jul 2008, 02:23 PM
Hello Marc,

I suggest you hook to the AppointmentDataBound and AppointmentInsert/AppointmentUpdate events to edit dates in the way you need and to save them in the database.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Michael
Top achievements
Rank 1
Answers by
Yana
Telerik team
Marc
Top achievements
Rank 1
Share this question
or