Next Previous Contents

2. Usage

2.1 Options

Language support

As at version 1.4.2, mdate supports four languages: English, Spanish, German and Polish (en, es, de 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

Fecha gregoriana      : 14-September-2003 (14/09/2003)
Número de día juliano : 2452897.0
Cuenta larga          : 12.19.10.10.12
Fecha Tzolkin         : 9 Eb
Fecha Haab            : 0 Chen

The default language is English (en). There is no support for regional language subsets (eg en_AU).

Output format

By default, Mdate will output a formatted printout of current date information, using the default Loundsbury 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

The -p, --parseable flag outputs this information in one line, which is handy for inclusion in emails or piped to other programs. Example:

$ mdate -p

JDN: 2452370.0 date:  05  04  2002 12.19.09.02.05  02 Chicchan  03 Uayeb 

The parseable flag can be combined in any way with any of the date options.

Date Formatting

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
@C century as 2 digits
@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.

Correlation Options

By default, Mdate uses the Loundsbury 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!)

Date Input

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'

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

In the same way, the -j, --julian=[DOUBLE] option will output the date with a specified Julian Day Number:

$ mdate -j 2452370

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

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'

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

Miscellaneous Options

The -h, --help option gives a simple display of help for Mdate.

The -v, -V, --version option outputs version information for Mdate.


Next Previous Contents