Results 1 to 5 of 5

Thread: TimeZones

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    TimeZones

    Hi!

    The users of my application span in diffrent countries. I am displaying couple of DateTime infos on a Grid, with NYC time (thats what stored in the database). But, they want to view those info, according to their Time Zones. How to accomplish this?

    Thanks.
    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: TimeZones

    The simple fact is that if you want use data in multiple time zones then it should be stored as UTC. You can then convert it to local time at each individual location.

    .NET has no specific support for time zones other than to be able to convert between UTC and local time. There's no in-built way to switch to a specific time zone, so you're just going to have to perform a manual calculation. Someone created a TimeZoneInfo class and posted in the VB.NET CodeBank forum. You may find that helpful in that regard.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: TimeZones

    Thanks
    Thanks.

  4. #4

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: TimeZones

    Quote Originally Posted by popskie
    If Im not wrong it could be posible in .net 3.5
    I just had a quick look and there is indeed a TimeZoneInfo class in .NET 3.5. I'm guessing that VBDT's CodeBank submission mimics that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width