ISO 8601 date format
The international standard for writing dates and times as text, such as 2024-01-15T10:00:00Z.
In more detail
Fields go from largest to smallest unit, so timestamps sort correctly as text. The trailing Z means Coordinated Universal Time, and RFC 3339 is the internet profile most software follows.
Examples
ISO 8601 times sort correctly as plain text, which is why SQLite and many log tools store them as YYYY-MM-DD HH:MM:SS strings.'occurred_at': '2024-01-15T10:00:00Z'date.today().isoformat()2024-03-01: SQLite date columns in the SQL course are text in this layout, so sorting them as text gives date order.Day-first dates such as 01/03/2024 sort wrongly and break SQLite date functions.Related terms
- UTC — Coordinated Universal Time, the worldwide reference time that does not change with seasons or time zones.
- time zone offset — The difference between a local time and UTC, written as +01:00 or -05:00 after a timestamp.
- event envelope — A standard outer structure that wraps an event's business payload with metadata such as event ID, type, version and time.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
- strftime() — strftime turns a date into text using format codes such as %Y-%m-%d; strptime does the reverse, parsing text into a datetime.
- datetime module — The standard library module for dates and times as real values you can compare, add to and format, not as text.
- DATE — A PostgreSQL column type that holds a calendar date, validates it, sorts it and supports date arithmetic.
- date() — SQLite functions that do calendar arithmetic and formatting on dates stored as year-month-day text.
- TEXT — The column type for character strings such as names, cities and, in SQLite, dates written as text.
Taught in
- Six Seconds, Every Secret — Certified Kubernetes Security Specialist (CKS) Exam Prep
- SBOMs: Knowing What You Ship — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Internal Audits, Sampling & Evidence Chains — Cybersecurity Fundamentals, GRC & Cryptography
- Headers, Envelopes And Event Metadata — Apache Kafka & Event Streaming
- Route Handlers: RESTful Endpoints with NextRequest — Next.js 15 & Modern App Router Architecture
- Dates, Times And Random — Hands-on Python: Complete Video Course & Book
- Post-Incident Review & Root Cause Analysis — Security Operations & Threat Hunting (SOC)
- Data Types And What To Choose — PostgreSQL, Indexing & Relational Data Modeling
- Ordering And Limiting Results — PostgreSQL, Indexing & Relational Data Modeling
- Runs In HCP Terraform: The cloud Block And Remote Execution — HashiCorp Terraform Associate (004) Exam Prep
- The Pager Goes Off At 2 A.M.: A Three-Question Triage — CompTIA Linux+ (XK0-006) Exam Prep
References
- RFC 3339: Date and Time on the Internet
- RFC 3339: date and time on the internet
- MDN: Date.prototype.toISOString()
- datetime.date.isoformat
- SQLite: date and time functions