LUNAR(1)

πŸ’– LUNAR(1) β€” the calendar conversion utility bestie πŸ’–

okay so you found lunar in the General Commands Manual section and you're like "what is this" β€” don't worry, I got you. this is a whole ✨calendar conversion utility✨ and honestly? iconic.


🌸 NAME 🌸

lunar β€” a calendar conversion utility. that's it, that's the girl. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

lunar [-usthg5b] year month day [hour]
lunar [-usthg5b] -i [-l] year month day [hour]
lunar --help

like. look at her. she's so versatile. πŸ’…


✨ DESCRIPTION ✨

so lunar does date conversion between the Gregorian Solar Calendar (SC) and the Chinese Lunar Calendar (LC). give it a date in either one and it'll also spit out the matching "shengxiao" (that's the animal of the year, yes the zodiac vibe πŸ‰) and the "ganzhi" characters. the date range it currently covers is from about 1900 A.D. to 2049 A.D. β€” so no, it will not do your birthday in 3000, sorry bestie 😭

for the sake of convenience, they choose the convention such that the solar and lunar year numbers of the first day of a lunar year are the same. for example, SC 1991.2.15 is LC 1991.1.1, while SC 1991.2.14 is LC 1990.12.30. also they choose the convention such that the solar and lunar hour numbers (in 24-hour clock) of a date are the same, even though a lunar day starts at 23:00 of a solar day. which means SC 1991.2.15.23 is LC 1991.1.2.23, while SC 1991.2.16.0 is LC 1991.1.2.0, and SC 1991.2.16.1 is LC 1991.1.2.1. the way the hours just… don't shift. it's giving intentional design decisions. πŸ‘‘

⚠️ the standard time of the Lunar Calendar is Beijing (Hong Kong) Standard Time, not GMT. be sure to adjust appropriately for other time zones and "Daylight Saving Time". fr fr, do not forget this one.

in the Lunar Calendar, a normal year has 12 months, and a leap year (run-nian) has 13 months, where the extra month is called a "leap month" (run-yue). for example, the leap month that follows immediately the 6-th lunar month is called the 6-th leap month. a (leap) month is either a short or long one, which has 29 or 30 days respectively. okay periodt. πŸ“…

there are 10 gan's and 12 zhi's. the ganzhi labeling of the year, month, day and hour of a date is a member of the Cartesian product GxGxGxG, where G = {1,2,...,60}. for example, "jia-zi" is 1, "yi-chou" is 2, and so on. and the ganzhi of the j-th leap month is the same as that of the j-th month. no cap. 🌈


πŸ’… OPTIONS πŸ’…

okay so since lunar was first packaged for Debian in 2002, the Debian package maintainer has made minor additions such as Big5 and UTF-8 support. more recently, lunar gained the ability to detect system locale and choose the correct character set. she learned. she grew. we love a glow-up. ✨

Lunar now also detects and displays the current China Standard Time by default, so that the year month day [hour] parameters are now optional for solar-to-lunar calendar conversion. so lazy-girl mode is fully supported. 🫢

the possible options are:

  • -b β€” output ganzhi in special "bitmap" characters. fancy.
  • -u, --utf8 β€” output hanzi or Chinese characters encoded in UTF-8.
  • -s β€” output simplified Chinese (for UTF-8 only).
  • -t β€” output traditional Chinese (for UTF-8 only).
  • -g, -h, --gb β€” output hanzi or Chinese characters encoded in (highest-bit-set) GB code.
  • -5, --big5 β€” output hanzi or Chinese characters encoded in Big5.
  • -i β€” convert a lunar date to solar date. the default is to convert a solar date to a lunar date. (so she's reverse-capable, main character energy πŸ’…)
  • -l β€” indicate the month is a lunar leap month. this option is meaningful only when the "-i" option is used. like, only then. don't come for her otherwise. πŸ™ˆ
  • --help β€” Print a help message.

Copyright (C) 1988, 1989, 1991, 1992, 2001 Fung F. Lee and Ricky Yeung

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

The last version of this program was released on July 23, 1992 as version 2.1a. This program was first released under the terms of GNU GPL on October 28, 2001 as version 2.2. Both versions are identical except for the license text. (the glow-up was literally just the license. obsessed. πŸ“œ)


🌟 AUTHORS 🌟

Fung F. Lee and Ricky Yeung β€” the founding mothers (well, fathers) of this whole operation. legends only. 🫢


πŸŽ€ ACKNOWLEDGEMENT πŸŽ€

The special "bitmap" file "lunar.bitmap" was contributed by Weimin Liu. thank you bestie, we see you. πŸ’–

Special thanks to Hwei Chen Ti who extended the tables from 2001 to 2049. that's 48 extra years of data and honestly? ate. πŸ”₯


πŸ’€ BUGS πŸ’€

Bug reports and comments should be sent to lee@umunhum.stanford.edu. yes, an email. it's giving 1992 and we respect the heritage. πŸ“§


🌈 DISCLAIMER 🌈

This software has no connection with our employers. nope. none. zero. this is a passion project, not a work thing. πŸ™ˆ


and that's the whole page bestie!! 🌸 this was Lunar version 2.2-7 (Debian), dated 15 May 2020 β€” ty for coming to my ted talk, go convert some calendars, ily, bye!! πŸ’–βœ¨πŸ¦‹πŸŽ€