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

[Solved] Datetime column's local timezone conversion issue

2 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samnang
Top achievements
Rank 1
Samnang asked on 14 Sep 2009, 03:25 AM
Hi,

I have a requirement of dispalying date without conversion to local timezone at browser. With the current Grid, it does conversion to local timezone which I don't want.

Is there any idea to prevent such conversion happend on client side?

Thanks,
Sam

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Sep 2009, 06:06 AM
Hi Sam,

I guess you want to display DateTimeColumn values in particular date format. If so you could set the DateFormatString property to provide a custom format for the items in the column.

ASPX:
 
<telerik:GridDateTimeColumn UniqueName="DateTime" HeaderText="Order Date" DataField="OrderDate" 
    DataFormatString="{0:dd/MM/yyyy}"
</telerik:GridDateTimeColumn> 

-Shinu.
0
Samnang
Top achievements
Rank 1
answered on 14 Sep 2009, 06:40 AM
Thanks again Shinu for your reply.

Actually, I don't have problem with date format. Let me try to explain what is going on.

I am using web service to do filtering/soring/paging invoked by javascirpt client's OnCommnad event. So databinding is happening on client side (browser). What happened is when databinding happens, Grid internally calls Date.localeFormat which convert to local timezone. For example, if date from server is 2008-12-31 11:59 PM PST, Grid will display 2009-01-01 if user is browsing from India.

Thanks,
Sam
Tags
Grid
Asked by
Samnang
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Samnang
Top achievements
Rank 1
Share this question
or