N
Nathan Sokalski
I asked a question about a week ago about how to get my local time, since my
application is running on a server halfway around the world. I have
determined that my code would look something like this:
Dim servertime As Date = Date.Now
Dim utctime As Date = servertime.ToUniversalTime()
Dim localtime As Date
I know that the last step would be to adjust the utctime value by the
appropriate amount using code such as utctime.AddHours(-5), but I am looking
for a way to get this value by supplying the timezone rather than an offset
(in other words, I am looking for a function that returns either a
System.TimeSpan or Integer when I enter the timezone) so that I can do
something such as
utctime.AddHours(GetTZOffset(TimeZones.EST))
Is there a function that does this, or any way to get the offset by
submitting the timezone? Thanks.
application is running on a server halfway around the world. I have
determined that my code would look something like this:
Dim servertime As Date = Date.Now
Dim utctime As Date = servertime.ToUniversalTime()
Dim localtime As Date
I know that the last step would be to adjust the utctime value by the
appropriate amount using code such as utctime.AddHours(-5), but I am looking
for a way to get this value by supplying the timezone rather than an offset
(in other words, I am looking for a function that returns either a
System.TimeSpan or Integer when I enter the timezone) so that I can do
something such as
utctime.AddHours(GetTZOffset(TimeZones.EST))
Is there a function that does this, or any way to get the offset by
submitting the timezone? Thanks.