Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET match users local date and time with the system time
    primarykey
    data
    text
    <p>I have some trouble understanding how to match users current date and time with the server time.</p> <p>Example: let's assume I have a website where users can register themselves. One profile option is that they can select their local time zone. For this there is a drop-down menu from where they can choose the correct time zone. So a user from China will select probably (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi, another user from Los Angeles will select (UTC-07:00) Mountain Time (US &amp; Canada) (i assume) and a guy from Paris will select (UTC+01:00) Brussels, Copenhagen, Madrid, Paris.</p> <p>The web application is running on a server in USA with it's specific time zone ...</p> <p>Now ... All these users will want to receive an email notification next Friday at 19:00 <strong>their local time zone</strong>!!!</p> <p>Here I am lost ... definitely the next Friday at 19:00 is not in the same time for all these users ...</p> <p>How can I map their profile time zone, so the service running on my site will send the email notification next Friday at 19:00 user's local time zone???</p> <p>I am at this stage at the moment ... populating the drop down menu with all time zones so users can select their current time zone in their profile.</p> <p>When the page load's than the dropdown is populated with the time zone:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { ddlUserTimeZone.DataSource = GetTimeZones(); ddlUserTimeZone.DataTextField = "Name"; ddlUserTimeZone.DataValueField = "ID"; ddlUserTimeZone.DataBind(); } public Collection&lt;TimeZoneItem&gt; GetTimeZones() { Collection&lt;TimeZoneItem&gt; timeZones = new Collection&lt;TimeZoneItem&gt;(); foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) { timeZones.Add(new TimeZoneItem { TimeZoneName = timeZoneInfo.DisplayName, TimeZoneID = timeZoneInfo.Id }); } return timeZones; } public struct TimeZoneItem { public string TimeZoneName { get; set; } public string TimeZoneID { get; set; } } </code></pre> <p>Now, can you guys help with the matching of the profile time zone with the current time so the email is sent in the correct time?</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload