Richard,
DateTime.Now will return the "current" time based on your time zone.
DateTime.ToUniv ersalTime will return GMT time.
You can subtract the two values to get the difference...
Dim now As DateTime = DateTime.Now
Dim nowGMT As DateTime = now.ToUniversal Time()
Dim diff As TimeSpan = now.Subtract(no wGMT)
Debug.WriteLine (diff, "diff")
Alternatively you could use the various properties of System.TimeZone :
Dim time As DateTime = DateTime.Now
Dim tz As TimeZone = TimeZone.Curren tTimeZone
With tz
Debug.WriteLine (.DaylightName, "daylight name")
Debug.WriteLine (.StandardName, "standard name")
Debug.WriteLine (.GetDaylightCh anges(time.Year ), "daylight
changes")
Debug.WriteLine (.GetUtcOffset( time), "utc offset")
Debug.WriteLine (.IsDaylightSav ingTime(time), "daylight saving
time")
End With
Hope this helps
Jay
"Richard" <Ri*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
Is there any way to get the time difference between Central(US) and GMT in
vb.net.
I'll appreciate your help/suggestion.
Thanks
RC