[Debian-zh-dev] Bug#854019: lunar: unmatched time when query solar 2017 01 28 22 and 2017 01 28 23

Xie Xun xiexun162534 at gmail.com
Fri Feb 3 06:48:14 UTC 2017


Package: lunar
Version: 2.2-4
Severity: important
Tags: patch

The bug was reported by <usv at localhost.localdomain>. However, it seems that
he/she's not reported the bug to the bug tracking system.
Below is a copy of his/her email:

___________________________________
Hi, Xie Xun
lunar datetime goback from 2017年 2月24日22时2017年 2月23日23时
when query the solar  from 2017 01 28 22      to 2017 01 28 23
thanks
lunar -u -s -i 2017 01 28 22
Lunar Version 2.2-6 (Debian) (January 2, 2017)

阳历: 2017年 2月24日22时 星期五
阴历: 2017年 1月28日亥时 生肖属鸡
干支: 丁酉年 壬寅月 壬午日 辛亥时 
用四柱神算推算之时辰八字: 丁酉年 壬寅月 壬午日 辛亥

lunar -u -s -i 2017 01 28 23
Lunar Version 2.2-6 (Debian) (January 2, 2017)

阳历: 2017年 2月23日23时 星期四
阴历: 2017年 1月28日子时 生肖属鸡
干支: 丁酉年 壬寅月 壬午日 庚子时 
用四柱神算推算之时辰八字: 丁酉年 壬寅月 壬午日 庚子
______________________________________

and his/her patch:

__________________________________________
Hi, Xie Xun
This is the patch for lunar about not continue datetime from lunar to solar
query:
--- lunar/lunar.orig    2001-10-29 13:55:39.000000000 +0800
+++ lunar/lunar.c    2017-02-03 06:22:18.957411341 +0800
@@ -250,7 +250,7 @@
    offset = Solar2Day(&solar);
    solar.weekday = (offset + SolarFirstDate.weekday) % 7;

-    /* A lunar day begins at 11 p.m. */
+    /* A lunar day begins at 11 p.m. of lastday */
    if (solar.hour == 23)
    offset++;

@@ -271,8 +271,8 @@
    int adj;
    Date *d;

-    /* A solar day begins at 12 a.m. */
-    adj = (lunar.hour == 23)? -1 : 0;
+    /* A solar day begins at 12 a.m. (00 a.m.) */
+    adj = (lunar.hour == 0)? -1 : 0;
    offset = Lunar2Day(&lunar);
    solar.weekday = (offset+ adj + SolarFirstDate.weekday) % 7;
    Day2Solar(offset + adj, &solar);

thanks
____________________________________________

USV seems to use an invalid email address, so I can't contact with him/her
directly.
Nevertheless, thank usv for his/her report.



-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-0.bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lunar depends on:
ii  libc6  2.19-18+deb8u7

lunar recommends no packages.

lunar suggests no packages.

-- no debconf information



More information about the Chinese-developers mailing list