CONVCAL(1)
NAME β¨
convcal β convert dates to different formats π (yes bestie, it's literally just that, it's giving one-job-icon)
SYNOPSIS π
convcal [OPTIONS] [DATE]
DESCRIPTION πΈ
Okay so convcal is part of the grace software package, which is an application for two-dimensional data visualization πβ¨. What convcal does is convert dates from and to various formats. Here's the lineup of date formats it supports β and heads up, hour, minutes and seconds are always optional π°οΈ:
isoβ1999-12-31T23:59:59.999europeanβ31/12/1999 23:59:59.999or31/12/99 23:59:59.999usβ12/31/1999 23:59:59.999or12/31/99 23:59:59.999daysβ123456.789secondsβ123456.789
The formats get tried in this order: user's choice, then iso, then european, then us. (And ngl there's zero ambiguity between the calendar formats and the numerical formats, so no order is specified for those two, they just vibe.) π
USAGE π¦
convcal reads the dates either straight off the command line, or from standard input if the command line has no date in it. π
The user's choice for the input format puts one format ahead of all the others in the trial list β and this is mainly a gift for US citizens, who would certainly prefer having the US format checked before the european one πΊπΈ. The default user's choice (nohint) does absolutely nothing, so the following formats in the list get checked instead. Periodt.
The separators between the various fields can be any characters in the set: " :/.-T". One or more spaces act as one single separator, the other characters can't be repeated, and the T separator is only allowed between date and time β mainly for iso8601. So the string "1999-12 31:23-59" is allowed (but, bestie, it is not recommended π). The - character is doing double duty here: it's a separator (the traditional iso8601 thing) and it's the unary minus (for dates way back in the far past, or for numerical dates). Two jobs, one character, main character energy honestly.
When the year is between 0 and 99 and is written with two or less digits, it gets mapped to the era beginning at wrap year and ending at wrap year + 99, like this:
[wy ; 99] -> [ wrap_year ; 100*(1 + wrap_year/100) - 1 ]
[00 ; wy-1] -> [ 100*(1 + wrap_year/100) ; wrap_year + 99]
so for example, if the wrap year is set to 1950 (which is the default value), then the mapping is:
- range
[00 ; 49]is mapped to[2000 ; 2049] - range
[50 ; 99]is mapped to[1950 ; 1999]
this is reasonably Y2K compliant and is consistent with current use β¨. Specifying year 1 is still possible using more than two digits, like this: "0001-03-04" is unambiguously March the 4th, year 1, even if the user's choice is us format π. However using two digits only is not recommended (we introduce a 2050 bug here so this feature should be removed at some point in the future ;-) π
Numerical dates (the days and seconds formats) can be specified using integer, real or exponential formats β and yes, the 'd' and 'D' exponant markers from fortran are supported in addition to 'e' and 'E' π§. They're computed according to a customizable reference date. The default value is given by the REFDATE constant in the source file. You can change this value however you want before compiling, and you can change it at will using the -r command line option. The default value in the distributed file is "-4713-01-01T12:00:00" β it's a classical reference for astronomical events π (note that the - is used here both as a unary minus and as a separator, sneaky).
The program can be used either for Denys's and gregorian calendars. It does not take into account leap seconds: you can think it works only in International Atomic Time (TAI) and not in Coordinated Unified Time (UTC) ... π Inexistant dates are detected, and they include year 0, dates between 1582-10-05 and 1582-10-14, February 29th of non leap years, months below 1 or above 12, ... π₯
OPTIONS π
A summary of the options supported by convcal is included below. Slay.
-hβ prints the help message onstderrand exits successfully π«Ά-iformat β set user's choice for input format; the supported formats areiso,european,us,days,secondsandnohint. At the beginning the input format isnohint, which means the program will try to guess the format by itself; if the user's choice does not allow it to parse the date, other formats are tried π-oformat β force output format; the supported formats areiso,european,us,days,secondsandnohint. At the beginning, the output format isnohint, which means the program usesdaysformat for dates read in any calendar format and uses iso8601 for dates read in numerical format π-rdate β set reference date (the date is read using the current input format); at the beginning the reference is set according to theREFDATEconstant in the code, which is-4713-01-01T12:00:00in the distributed file π-wyear β set the wrap year to year β
SEE ALSO π
AUTHOR π
Luc Maisonobe πΈ
This man-page was written by Jan Schaumann <jschauma@netmeister.org> as part of "The Missing Man Pages Project". Please see http://www.netmeister.org/misc/m2p2/index.html for details. π
okay that's the whole thing bestie, you're officially a date-conversion expert, no cap π«Άβ¨
grace Β· August 11, 2001 β mwah, ty for reading, ily, bye ππ
π¦ where this page comes from
- debian bookworm: grace 1:5.1.25-13 Β· GPL-2.0-or-later
- debian trixie: grace 1:5.1.25-18 Β· GPL-2.0-or-later
- ubuntu noble: grace 1:5.1.25-14 Β· GPL-2.0-or-later
- ubuntu questing: grace 1:5.1.25-18
- ubuntu resolute: grace 1:5.1.25-18build1 Β· GPL-2.0-or-later
- ubuntu stonking: grace 1:5.1.25-19 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms