Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you just setting up this service? If so, <strong><em>run your web servers and database servers on Universal Time Coordinated</em></strong> (UTC or Zulu) time, not a local time zone. Everything is far easier to manage if you do that. I learned this the hard way. </p> <p>UTC used to be called Greenwich Mean Time; it is timezone +00:00. It doesn't change for daylight savings time like US and European local time does.</p> <p>This time zone thing is a pain, and worth getting right. Some countries have half-hour time zones.</p> <p>At any rate, once you know each user's preferred time zone, and the time she wants her notification, you can then convert the time from local to UTC and store it.</p> <p>Try something like this to get the user's hour and minute into UTC. (Time zone conversions need a date, because they depend on daylight savings time rules. There's one more complication. On the day when a time zone switches from daylight to standard, or vice versa, the UTC time for a notification will change. Most people handle this by recomputing the UTC date and time of the next notification (tomorrow's notification) as they send each notification. Consider this code.</p> <pre><code>TimeZoneInfo userLocal = ;//user's time zone int hour = ;//whatever the user wants int minute = ;//whatever the user wants DateTime tomorrow = DateTime.Now.AddDays(1); int year = tomorrow.Year; int month = tomorrow.Month; int day = tomorrow.Day; DateTime notificationTime = new DateTime(year,month,day, hour,minute,0, DateTimeKind.Unspecified); DateTime tomorrowNotificationTime = TimeZoneInfo.ConvertTimeToUtc( notificationTime,userLocal); </code></pre> <p>This should get you the UTC time you need to deliver this user's notification tomorrow, in the correct time zone for tomorrow's date.</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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