Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
to change timezone
posted

Hi,

I have a win application which is using infragistics win grid to show a set of data based on certain search parameters.I am using c# coding. I am using using a

Infragistics.Win.UltraWinSchedule.

UltraCalendarCombo control to provide date and time as serach parameter. Now when a user from hong kong logs in ,the timezone will be hong kong timezone.I want it to be converted to GMT and then passed as serach parameter .. Can i achieve this using Infragistics.Win.TimeZoneInfo  class. I am using c# coding.. can i get some sample code related to this

  • 18495
    Suggested Answer
    posted

    Hello,

    As it turns out, you don't even need to use the TimeZoneInfo class to do what you want.  The .NET Framework has built-in functionality for converting dates.  A line of code like the following should do the trick:

    DateTime.SpecifyKind(localDateTime,DateDimeKind.Local).ToUniversalTime()

    For "localDateTime" you should pass in the DateTime value you want converted to GMT.