user7441202
user7441202

Reputation:

Getting Client local timezone in VB.NET

I'm creating a form to be filled and submitted by users using VB.net. This form depends on the client's local timezone and i want this timezone to change with daylight savings.

I tried looking for solutions online and all were in JavaScript. Is there a way to find the client local timezone using VB.NET?

It worked using javascript. The code is:

function GetDate() {
var offset = new Date().getTimezoneOffset();
console.log(offset);
}

Upvotes: 1

Views: 2280

Answers (1)

Tobbs
Tobbs

Reputation: 1130

Try these:

System.TimeZone.CurrentTimeZone.GetUtcOffset()
System.TimeZoneInfo.Local.IsDaylightSavingTime(Now)

or this:

DateTimeOffset.Now.Offset

Upvotes: 3

Related Questions