[PATCH 21.5] Fix signs in time zone string.
Marcus Crestani <[email protected]> Tue, 30 Sep 2014 08:13:34 +0200
| Newsgroups | gmane.emacs.xemacs.patches |
|---|---|
| Message-ID | <[email protected]> |
PATCH 21.5 Currently, Fencode_time calculates wrong dates in respect to local timezones. The problem is caused by switched signs in the code that builds the time zone string, the attached patch fixes this. I'll push in two days if nobody objects. diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-09-30 Marcus Crestani <[email protected]> + + * editfns.c (Fencode_time): Switch signs when calculating the time + zone string. (The offset indicates the value one must add to the + local time to arrive at UTC.) + 2014-09-23 Jerry James <[email protected]> * floatfns.c (round_two_bignum_1): Fix memory leak. diff --git a/src/editfns.c b/src/editfns.c --- a/src/editfns.c +++ b/src/editfns.c @@ -1155,7 +1155,7 @@ Year numbers less than 100 are treated just like other year numbers. If you want them to stand for years in this century, you must do that yourself. -arguments: (SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE &rest REST) +arguments: (SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */ (int nargs, Lisp_Object *args)) { @@ -1192,7 +1192,7 @@ int abszone = abs (XFIXNUM (zone)); /* #### I have no idea what this conforms to, but the compiler has stopped whining. */ - sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "-" : "+", + sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "+" : "-", abszone / (60*60), (abszone/60) % 60, abszone % 60); tzstring = tzbuf; } -- Marcus