JUST FUCKING USE UTC

--:--:--UTC
 

Coordinated Universal Time is the single reference time standard that works. No more timezone guessing, timestamp confusion, or midnight fuckups. If your code uses local time, you're already behind.

Learn about UTC

Why local time hurts

Daylight saving breaks the clock

Once a year 02:30 doesn't exist. Once a year 01:30 happens twice. Good luck working out which one your timestamp meant.

Your durations are an hour off

Subtract two local times across a clock change and you get 23 or 25 hours in a "day". UTC has no gaps and no repeats, so the maths just works.

Your logs won't sort

Three servers in three timezones, one incident. Now interleave those logs by hand at 3am. With UTC, sorting by timestamp is sorting by time.

"Midnight" depends who you ask

A nightly job on local time runs at a different moment on every server, and "today" changes depending on where the code happens to run.

Store it in UTC. Compute in UTC. Convert only when a human has to read it.

How to get UTC

new Date().toISOString()
Python
from datetime import datetime, timezone
datetime.now(timezone.utc)
Shell
date -u +"%Y-%m-%dT%H:%M:%SZ"
Go
time.Now().UTC()
SET TIME ZONE 'UTC';
SELECT now();
Java
Instant.now()
curl -L justfuckinguseutc.com

Using UTC? Say so

just fucking uses UTC

Markdown for your README
[![just fucking uses UTC](https://justfuckinguseutc.com/badge.svg)](https://justfuckinguseutc.com)

Inspired by