From version 1.4.5, a compile-time option was added for those preferring the new Romanized Mayan calendar names to the old ones, e.g. Kumk'u (new) for Cumku (old) and 'Ahaw (new) for Ahau (old). I'm interested in feedback about this option, and whether it could be a format item in its own right.
As at version 1.4.5, mdate supports five languages: English, Spanish, German, French and Polish (en, es, de, fr and pl). A runtime option was added so you could use a different language. The language support is compiled-in and currently ignores environment language variables.
Example usage:
$ mdate -L es
NDJ: 2453168.0 fecha: Fri 11 06 2004 12.19.11.06.03 7 Ak'bal 06 Sots
The default language is English (en). There is no support for regional language subsets (eg en_AU). Other languages may be compiled as the default.
The previous default behaviour of Mdate was to output a formatted printout of current date information, using the default Lounsbury correlation for today's date:
$ mdate
Gregorian Date : 05-April-2002 (05/04/2002)
Julian Day Number : 2452370.0
Long Count : 12.19.09.02.05
Tzolkin Date : 2 Chicchan
Haab Date : 3 Uayeb
However, pretty output formatting is now a compile-time option only, due to ongoing problems (i.e. bugs) on several platforms.
The old -p, --parseable
flag is now the default behavior, and outputs
this information in one line, much like date(1)
. Example:
$ mdate
JDN: 2452370.0 date: 05 04 2002 12.19.09.02.05 02 Chicchan 03 Uayeb
The parseable flag is now effectively ignored when pretty formatting is not compiled in.
You may want to specify your current date in a specific way, using one of mdate's formatting options. Here is the full list:
@a abbreviated weekday name
@A full weekday name
@b abbreviated month name
@B full month name
@d weekday (01..31)
@e weekday without a leading zero
@F ISO format Gregorian date (%Y-%m-%d)
@f ISO format Gregorian date (%Y%m%d)
@h unpadded Haab date
@H padded Haab date
@l Long Count
@M named Gregorian month
@m numbered Gregorian month
@t padded Tzolkin date
@T unpadded Tzolkin date
@y year as decimal 00 to 99
@Y Gregorian year
@n add a newline to the output
@j add a tab to the output
Like date(1)
, mdate will format a date when given a `+' option, for
example:
$ mdate -d '07 09 2003' +'@f @l'
20030907 12.19.10.10.15
This was specifically requested for those who like to add a Mayan byline to
emails and web pages. However, mdate has not ever supported time of day
parsing/formatting, so it's not rfc822 compliant! Most formats are merely
passed on to strftime(3)
where applicable.
By default, Mdate uses the Lounsbury correlation which is equivalent to the Julian Day Number 584285. You're not forced to use this if you don't want to. Here are a couple of options for the correlationally-strict :)
The -g, --gmt
option uses the standard Goodman-Martinez-Thompson
correlation (GMT for short). It corresponds to the Julian Day Number 584283.
If you don't agree with either of the above correlation constants, the -c,
--correlation[=DOUBLE]
allows you to specify a correlation of your own.
Don't be surprised, however if it doesn't work the way you intended,
especially if you set the Julian Day Number too low (see the
Limitations section to understand why!)
You probably want to check a specific date at some point. This can be done in several different ways, depending on the kind of date you already have.
The -d, --dmy[="dd mm [-]yyyy"]
option allows you to specify a
Gregorian date. You can also specify negative (BC) years.
$ mdate -d '05 04 2002'
JDN: 2452311.0 date: Tues 05 02 2002 12.19.08.17.06 8 Kimi 04 Pax
In the same way, the -j, --julian=[DOUBLE]
option will output the
date with a specified Julian Day Number:
$ mdate -j 2452370
JDN: 2452370.0 date: Fri 05 04 2002 12.19.09.02.05 2 Chik'chan 03 Wayeb
Notice that you can leave the decimal part out if you wish.
Finally, the -l, --longcount[="nn nn nn nn nn"]
option does the same
thing with a Mayan long count date input:
$ mdate -l '12 19 09 02 05'
JDN: 2452370.0 date: Fri 05 04 2002 12.19.09.02.05 2 Chik'chan 03 Wayeb
The -h, --help
option gives a simple display of help for Mdate.
The -v, -V, --version
option outputs version information for Mdate.