Skip to content

Instantly share code, notes, and snippets.

@siruguri
siruguri / gist:06b352e27e05b7fd842ce888df1eadd6
Last active August 29, 2023 23:26
Ruby strptime examples
from https://apidock.com/ruby/DateTime/strftime
Basic:
Date (Year, Month, Day):
%Y - Year with century (can be negative, 4 digits at least)
-0001, 0000, 1995, 2009, 14292, etc.
%C - year / 100 (round down. 20 in 2009)
%y - year % 100 (00..99)
%m - Month of the year, zero-padded (01..12)