Bootstrapping to UTC (BtUTC) is the algorithm Tidepool uses to infer UTC datetimes from the relative datetimes stored on diabetes devices in combination with the timezone of the most recent data on the device and the set of display time settings changes on the device.
An object involving only date information—year, month, and day—and referring to a date in the 365-day Gregorian calendar; represented best in ISO 8601
The 365 day calendar is an abstraction that does not quite line up to universal time (i.e., UTC) because it guarantees exactly 365 days in a typical year and 366 in a leap year, while universal time does not (there are also leap seconds, etc. which add up to slightly more than 365 or 366 days). As a concept outside of universal time, a calendar date does not need or include timezone information.
2016-01-10 is a calendar date. (In particular, it is the date David Bowie died... 😢)
Examples of calendar dates in Tidepool's code are the two dates stored in a PwD's profile:
An object involving only time information—hours, minutes, seconds, and possibly milliseconds—and referring to a point within a standard twenty-four hour day.
The terms "time" and "timestamp" can be problematic and potentially confusing because they don't transparently represent the inclusion of date information. Thus, for maximum precision and clarity, we recommend using the term "datetime" when both clock time and date information are part of the object in question, both in documentation and in code.
We have borrowed this terminology with love from the
datetime package in Python's standard library.
The concept of right now, today, as you are reading this is a datetime. 😉
time are both properties in the Tidepool data model that encode datetimes.
If you are a PwD, look at one of your diabetes devices right now; find the datetime display. Congratulations, unless you are looking at the time display on your iPhone for a Dexcom G5 system, you are looking at a display time.
The major timezones—Pacific, Mountain, Central, and Eastern—in the continental United States all observe DST according to a federally-legislated schedule. However, most of Arizona and Hawaii do not observe DST.
A Unix time in milliseconds instead of seconds.
Presently there are no examples of hammertimes in the data Tidepool stores, but new front-end data visualization code parses each ISO-formatted timestamp (i.e.,
time) into a hammertime during the data preprocessing because repeatedly parsing String timestamps is very expensive in terms of performance.
ISO 8601 is the International Organization for Standardization's (ISO) standard covering the exchange of date- and time-related data.
At Tidepool, we use the Zulu format with milliseconds—i.e.,
time field. For the relative datetime stored in the
deviceTime field, we use the date and time formatting specifications to second precision——that is to say,
"Person with diabetes" or at Tidepool, equivalently, "Person with data."
This phrase (and its abbreviation PwD) is used in order to avoid the disease-centric term "diabetic." It is very commonly, though not universally, used throughout the diabetes community.
US/Pacific is the timezone where Tidepool's headquarters are located.
Pacific/Easter is the timezone for the Easter Islands. More timezone examples can be seen by hovering on the map below the fold on Moment Timezone's landing page.
upload type in Tidepool's data model stores a timezone in—wait for it...—the
Timezones and timezone offsets do not map to each other one-to-one because of DST. For example, the
US/Pacific timezone has a timezone offset of -420 during DST and a timezone offset of -480 when standard time is in effect. Be very careful, both in thought and in code, to keep these concepts of timezone and timezone offset distinct!
Australia/Melbourne has a timezone offset of +660 approximately October through March (summer months in the southern hemisphere!) when DST is observed and +600 when standard time is observed the remainder of the year.
Unix time is also sometimes referred to as "POSIX time" or "epoch time."
We don't use Unix times at Tidepool. We use hammertimes instead.
Coordinated Universal Time (UTC) is the primary date & time standard by which planet Earth regulates clocks and time.
UTC does not observe DST, and it is the successor to Greenwich Mean Time (GMT), which is no longer a functioning global standard. In the ISO 8601 standard,
Z (for "Zulu", from the radio alphabet) is a shorthand for represented the timezone offset of UTC (i.e.,
In Tidepool's data model, all
time fields are in UTC.
a. a.k.a. @jebeck's very favorite page on the whole of the Internet to link to. ↩