Incrementing dates in Python

When everything is text, one spends 50% of their time parsing strings and the other 50% fixing errors produced by representing everything as text.

If you ask a professional software engineer how to store a date in a database like PostgreSQL, they’ll ask questions related to timezones and other time-related oddities, but the end result will almost always be use this datetime-aware column type.

Ask your Terminal, and it’ll say everything is text or some unprintable garble of beeps and glyphs.

When a stringified date came my way from an MDX file in an Org file, I decided to check out Python’s built-in support for manipulating dates.

from datetime import datetime, timedelta
print(datetime.fromisoformat('2024-01-16').date() + timedelta(days=1))

The equivalent in Ruby looks something like this:

require 'date'
puts Date.parse('2024-01-16') + 1