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

Converting DateTime from UTC to local

1 Answer 481 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 22 Jan 2016, 05:03 PM

I'm generating a grid using ToDataSourceResult(), and I pass an IQueryable to that. LINQ to Entities doesn't support anything like ToLocalTime(), so how can I perform that conversion?

The property is a DateTime type in MVC, and it displays in the grid accordingly. If I specify to use a time in addition to the date, it uses the raw UTC value pulled from the DB (as expected). How can I convert it to local time, either server-side with the DataSourceResult or client-side with the grid itself or manipulating it using jQuery?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 25 Jan 2016, 03:43 PM
Hello Steven,

Please examine the following thread that discusses how you can implement the scenario:


Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or