Created
April 15, 2022 16:58
A shell function to wrap a Perl invocation to tell you what day of March 2020 it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I didn't write this, but it's too good not to share. | |
# See also: https://www.mcsweeneys.net/articles/heres-how-time-works-now. | |
march () { | |
perl -e 'use Date::Parse; use POSIX; my @t = localtime; print strftime ("%a Mar ", @t) . int (1 + 0.5 + ((str2time (strftime ("%Y-%m-%d 3:00", @t)) - str2time ("2020-03-01 3:00")) /(60*60*24))) . strftime (" %X %Z 2020\n", @t);' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.mcsweeneys.net/articles/heres-how-time-works-now