Results 1 to 3 of 3

Thread: [RESOLVED] TimeZoneInfo.ConvertTimeBySystemTimeZoneId

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Resolved [RESOLVED] TimeZoneInfo.ConvertTimeBySystemTimeZoneId

    Dim dt As Date = Date.Now
    Message.Show(TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, "Central Standard Time").ToString("t"))

    This will convert my standard eastern time into Central Time. How about if I wanted to convert to Alaska time? I tried "Alaska" and "Alaska Standard Time" but didn't have any luck.
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: TimeZoneInfo.ConvertTimeBySystemTimeZoneId

    Hope this gives you some ideas

    Code:
            'show all
            Dim lot As List(Of TimeZoneInfo) = TimeZoneInfo.GetSystemTimeZones.ToList
    
            For Each tz As TimeZoneInfo In lot
                Debug.WriteLine(tz.DaylightName & " " & tz.StandardName & " " & tz.Id)
            Next
    
            Dim s As String
            Dim dt As Date = Date.Now
            s = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, "Alaskan Standard Time").ToString("t")
            Debug.WriteLine(s)
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Re: [RESOLVED] TimeZoneInfo.ConvertTimeBySystemTimeZoneId

    Ugh, thank you!
    -RaY
    VB .Net 2010 (Ultimate)

Tags for this Thread

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