damned_colonial: A Babbage machine, and the words "Difference engine" (difference engine)
damned_colonial ([personal profile] damned_colonial) wrote in [community profile] command_liners2010-04-17 02:53 pm

cal

One of my favourite random unix command line things:

skud@Watson:~$ cal 05 1891
      May 1891
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

skud@Watson:~$ cal 04 1891
     April 1891
Su Mo Tu We Th Fr Sa
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30


I use this all the time when writing fic in historical fandoms! (It also works for the future, even beyond 2038.)

I've never yet written anything set in September of 1752, but this is interesting:

skud@Watson:~$ cal 09 1752
   September 1752
Su Mo Tu We Th Fr Sa
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30


I'm not sure if it's locale aware, though... 1752 was the British (and colonies) switchover to the Gregorian calendar, but Russia didn't switch til 1918, and Greece til 1923. Anyone know?
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2010-04-17 11:21 pm (UTC)(link)
If you use ncal instead of cal, the -s country_code option can be used to tell it which swithover to use.
jld: (popcorn)

[personal profile] jld 2010-04-18 01:24 am (UTC)(link)
Meanwhile, on NetBSD, there's a cal with a -R reform-spec option, which takes either an arbitrary date or the spelled-out name of a country. (And doesn't turn the calendar sideways like ncal does.)

Hooray for Unix diversity. At least it's not as bad as when I was trying to make a cross-platform calendar(1) setup.