Timing of notifications

The mobile notifications that can be created with LiveCode will be sent the moment you ask for it to be sent. Strangely though, the value is based on the number of seconds since midnight on January 1st, 1970, specifically, in part of London! Well, it's named after an area of London called Greenwich.

Greenwich Mean Time, often referred to as GMT, has been used as the standard for measuring time. It is somewhat superseded by UTC (Coordinated Universal Time), but in either case, it represents the exact current time at least for countries that are within the same time zone as Greenwich. The rest of us add or subtract some amount of time from that value.

In order to adapt to the fact that the Earth doesn't go around the Sun in an exact number of days or even an exact number of quarter days, calendars are adjusted by one day every four years, though not on 100 year boundaries, except for every 400 years (for example, the year 2000 was a leap year). These adjustments are still not enough to keep the clocks on time! The clocks are out of time by about 0.6 seconds a year, and so there are "Leap Seconds" added to compensate for that. In theory, Leap Seconds could be used to subtract one second, but as of yet, this hasn't been needed, as they have only been used to add one second.

None of this affects the number of seconds since midnight of January 1, 1970, but it does mean that converting LiveCode's seconds into time and date using your own arithmetic won't give you the right time. Yet, it's still used as the basis for notifications. This value is usually referred to as Unix Time.

It doesn't matter much though if you end up sending someone a Happy Birthday message 25 seconds early! Don't worry, the way we'll calculate the notification time will take care of the oddity.

Date and time pickers

As mentioned in the preceding section, mobile notifications use the number of seconds since midnight of January 1, 1970 and don't add on the 25 seconds, or Leap Seconds, that have occurred since then. When we present the date and time pickers to the user, the selections the user makes will come back as the actual current or future time. We will adjust for that later.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.250.114