Module 3 · Data, Variables, Samples, and Measurement Lesson 26 of 120

Timestamps, Time Zones, Calendars, and Observation Time

Different clock strings can describe the same instant.

2:38 clip1:21:39–1:24:18 in the full courseWatch on YouTube

Transcript

23 sentences · select one to jump there

Check your understanding

Are event time and receipt time interchangeable?

Choose one answer

Code lab

Run it yourself

The lesson source in 7 languages. Edit it, run TypeScript and Python right here, and compare with the expected output.

026-timestamps-time-zones-calendars-and-observation-time.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 026 of 120
 * Timestamps, Time Zones, Calendars, and Observation Time
 * Module 03: Data, Variables, Samples, and Measurement
 *
 * Scenario: Different clock strings can describe the same instant
 * Rule:     event time ≠ receipt time ≠ decision time
 *
 * Try it:   Are event time and receipt time interchangeable?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/data-variables-samples-and-measurement/timestamps-time-zones-calendars-and-observation-time/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson026() {
  const a = Date.parse("2026-01-01T10:00:00Z");
  const b = Date.parse("2026-01-01T12:00:00+02:00");
  const received = Date.parse("2026-01-01T10:00:05Z");
  const result = {sameInstant: a === b,
    latencySeconds: (received - a) / 1000};
  return result;
}

export const checkedResult = {"sameInstant":true,"latencySeconds":5};

// Run this file directly: npx tsx lessons/03-data-variables-samples-and-measurement/026-timestamps-time-zones-calendars-and-observation-time.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson026(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "sameInstant": true,
  "latencySeconds": 5
}

Prefer your own machine? Every file is in the course repository · open it in Codespaces.

Lesson notes

The rule

event time ≠ receipt time ≠ decision time