I am trying do to something like this:
On a client side I have datepicker for selecting date, drop down for selecting an hour, and drop down with time zones for selecting user time zone.
I am sending this info to server. On a server side, I want to accomplish this:
Take date and time values, and check what is the value of time zone. If it is for example "UTC+1" (or any other +- value of UTC time), convert that into UTC, before saving.
What I am not sure how to do it is: What value should I send from client as time zone information so server can detect it is a for example UTC+1.
I saw examples like this:
TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
On how to find out what is the time zone by its id, but I cannot do something like this:
TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("UTC+1");
Because, I get an exception, of course:
Additional information: The time zone ID 'UTC+1' was not found on the local computer.
Does someone know what is Id for all UTC+-someNumber, or there is a way to detect timezone from UTC string in some different way?
Did someone had experience whit this kind of a conversion?