0

I am building an application that has a sign up page with the following fields.

  • Name (Free text)
  • Email (Free text)
  • Address (Free text)
  • TimeZone (Dropdown list with a number of timezones)

The client requires the timezone field to be pre-populated with the current users timezone, rather than them having to find the most appropriate one.

I thought the request header might provide this info but i don't see anything.

Does anyone know how to get this using ASP.Net MVC?

user1786107
  • 2,921
  • 5
  • 24
  • 35
  • 6
    Take a look at [How to get current user timezone in c#](http://stackoverflow.com/questions/8194016/how-to-get-current-user-timezone-in-c-sharp) or this one [Can You Determine Timezone from Request Variables?](http://stackoverflow.com/questions/338482/can-you-determine-timezone-from-request-variables) – Reza Aghaei Apr 01 '16 at 17:57

1 Answers1

0

This information is not provided in the header.

You would need to get their location and get the timezone from that.

Two options to get location are the Html5 location or base it on their IP address use a service to approximate their location.

Andy T
  • 10,223
  • 5
  • 53
  • 95