Richard,
DateTime.Now will return the "current" time based on your time zone.
DateTime.ToUniversalTime 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.ToUniversalTime()
Dim diff As TimeSpan = now.Subtract(nowGMT)
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.CurrentTimeZone
With tz
Debug.WriteLine(.DaylightName, "daylight name")
Debug.WriteLine(.StandardName, "standard name")
Debug.WriteLine(.GetDaylightChanges(time.Year), "daylight
changes")
Debug.WriteLine(.GetUtcOffset(time), "utc offset")
Debug.WriteLine(.IsDaylightSavingTime(time), "daylight saving
time")
End With
Hope this helps
Jay
"Richard" <Ri*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.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