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

Grid Column DataFormatString="{0:MM/dd/yyyy HH:mm}" issue with timezone

1 Answer 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dheeraj
Top achievements
Rank 1
Dheeraj asked on 01 Aug 2012, 08:45 AM
HI,

I am using below code
<telerik:GridBoundColumn DataField="ActualAuctionStartTime" HeaderText="Actual Start" DataType="System.DateTime"
                            SortExpression="ActualAuctionStartTime" UniqueName="ActualAuctionStartTime" DataFormatString="{0:MM/dd/yyyy HH:mm}">
                            <HeaderStyle Width="10%" />
                        </telerik:GridBoundColumn>

Now my Server is in PST timezone while i am accessing this in IST time zone.

When Time is : 7/31/2012 22:56 its converting it to 08/01/2012 11:26.

Can you please resolve my problem as soon as possible. Its been critical to me.

Thanks
Dheeraj

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 06 Aug 2012, 06:51 AM
Hi,

Thank you for contacting us.

In ASP.NET environment, when the user requests a page from the server, the server executes the code that is associated with this request, this includes the current date and time.

So, once you request the page, the server creates it in accordance with its settings and then serve it the same way as it was rendered, in your case that mean you will get the time in PST time zone, not in the IST time zone.

Keeping this in mind, there is no automatic way for changing the time zone for different clients. In order to get such functionality, you could provide a drop-down list for the user to choose the desired time zone and then in the SelectedIndexChanged event to call Response.Redirect to the same page and in the Page_PreInit event to change the current time zone of the server.

I hope this information helps. Let me know if you need further assistance.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Dheeraj
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or