1

A long, long time ago... there was a Unix (not necessarily Linux[1]) program that would spit out today's date in a variety of formats.

In other words, it did what http://www.public.asu.edu/~checkma/today.html does, but in pure text, not HTML (HTML didn't exist at the time), and with fewer outputs.

The program I'm thinking of isn't gcal (gcal didn't exist at the time, and GNU wasn't well known), but some of the gcal manuals and online tutorials suggest gcal can also do this. However, I haven't been able to figure out how.

[1] It was probably SunOS; I think it was before SOLARIS came out.

EDIT: I just found a program called 'ddate' that does a very small part of this by returning the Discordian date (but not the others):

> ddate
Today is Pungenday, the 45th day of Discord in the YOLD 3183

It turns out calendar -f /usr/share/calendar/calendar.discord -A 0 will spit out the same output (which surprised me, since I'd forgotten that 'calendar' was more than a reminder program), but is also very limited in choice of calendars.

A program called hebcal (https://www.gsp.com/cgi-bin/man.cgi?section=1&topic=hebcal) apparently did this for Hebrew calendars, but I'm sure what I saw listed the same date in multiple formats-- it's possible it combined hebcal, ddate, and other programs in a shell script.

2 Answers2

0

I found your question while looking for the same thing and I decided to write cadate, a node CLI to do that, based on the library Luxon, which is itself based on the native API Intl.

A few examples:

$ cadate --iso8601 --calendar chinese
35-07-30
$ cadate --full --calendar hebrew 
Elul 29, 5778
$ cadate --full --locale ar --numbering arab --calendar islamic
٢٩ ذو الحجة ١٤٣٩

You can find more examples of usage on GitHub, I hope you will find it useful.

vinc
  • 1
0

Date formats according to country specific conventions are specified in the locales.

$ sudo locale-gen ar_EG.UTF-8 he_IL.UTF-8
Generating locales (this might take a while)...
  ar_EG.UTF-8... done
  he_IL.UTF-8... done
Generation complete.
$ for loc in ar_EG.UTF-8 he_IL.UTF-8; do LC_TIME=$loc date +%c; done
28 أبر, 2017 CEST 09:00:19 م
CEST 21:00:19 2017 אפר 28 ו'
Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
  • OK, but I don't mean giving the Gregorian date with different month and weekday names. I mean "Today is Friday, Eris 2, 556 (5-0556-05-02) in the Goddess Lunar Calendar" sort of thing. The link in the original post has more examples. –  Apr 28 '17 at 20:36
  • @barrycarter: No, that aspect is apparently not addressed by my pointer. Just wanted to mention what's available by default. – Gunnar Hjalmarsson Apr 28 '17 at 20:49