LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2543|回复: 6

考考你:如何把阳历的日期换算成阴历?

[复制链接]
发表于 2004-5-23 15:04:57 | 显示全部楼层 |阅读模式
欢迎大家讨论 :thank
发表于 2004-5-23 16:38:59 | 显示全部楼层
好像没有公式,只能弄个对应表吧?
 楼主| 发表于 2004-5-23 16:42:51 | 显示全部楼层
这是肥虾提供的连接
http://tool.haodx.com/wnl.htm
但是,如果用shell,能不能做到呢?:ask
发表于 2004-5-24 15:44:33 | 显示全部楼层
Package: lunar
Priority: optional
Section: utils
Installed-Size: 41
Maintainer: Anthony Fok <foka@debian.org>
Architecture: i386
Version: 2.2-2
Depends: libc6 (>= 2.2.5-13)
Filename: pool/main/l/lunar/lunar_2.2-2_i386.deb
Size: 12138
MD5sum: bfb96bed940d24f8cf6fbd44ab4dea7d
Description: Chinese Lunar Calendar conversion utility.
The program performs date conversion between the Gregorian Solar Calendar
(SC) and the Chinese Lunar Calendar (LC).  Given a date in either calendar,
the program also outputs the corresponding "shengxiao" animal of the year)
and "ganzhi" characters.  The date range currently covered is from about
1900 A.D. to 2049 A.D.
发表于 2004-5-25 16:51:28 | 显示全部楼层
最初由 javalee 发表
这是肥虾提供的连接
http://tool.haodx.com/wnl.htm
但是,如果用shell,能不能做到呢?:ask


打不开呢。。。5555。。。
发表于 2004-5-26 18:34:03 | 显示全部楼层
怎么大家都开始讨论这个问题了?是不是看到chinaunix上的讨论了?
把我的意见再贴一遍:
阴历和阳历的转换是不能通过公式推导的,因为阴历是通过天文演算得到的。常用的办法是做一个对照表,lunar和ccal程序都是这样做的。作一个用 shell常用工具更容易处理的映射表,用gawk、grep、bc之类应该也很容易作这个阴阳历转换,不过可能会有点烦琐,不象高级语言那么方便。
C 编写的 lunar 和 python 编写的 ccal 在这里:
http://cxterm.sourceforge.net/ccal.html
 楼主| 发表于 2004-5-26 20:15:33 | 显示全部楼层
呵呵呵呵~~~ :thank
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表