Mercurial > hg > xemacs-beta
comparison src/editfns.c @ 5813:36dddf9d90d1
Fix calculation of time zone string in Fencode_time.
author | Marcus Crestani <marcus@crestani.de> |
---|---|
date | Thu, 02 Oct 2014 10:19:00 +0200 |
parents | 427a72c6ee17 |
children |
comparison
equal
deleted
inserted
replaced
5812:7b42a97af782 | 5813:36dddf9d90d1 |
---|---|
1188 if (STRINGP (zone)) | 1188 if (STRINGP (zone)) |
1189 tzstring = LISP_STRING_TO_EXTERNAL (zone, Qtime_zone_encoding); | 1189 tzstring = LISP_STRING_TO_EXTERNAL (zone, Qtime_zone_encoding); |
1190 else if (FIXNUMP (zone)) | 1190 else if (FIXNUMP (zone)) |
1191 { | 1191 { |
1192 int abszone = abs (XFIXNUM (zone)); | 1192 int abszone = abs (XFIXNUM (zone)); |
1193 /* #### I have no idea what this conforms to, | 1193 /* We specify the time zone in offset notation (see `man |
1194 but the compiler has stopped whining. */ | 1194 tzset' for details). The offset indicates the value one |
1195 sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "-" : "+", | 1195 must add to local time to arrive at UTC. Thus, we sign |
1196 the offset with a `-' if the time zone is east of GMT; we | |
1197 sign the offset with a `+' if the time zone is GMT (then | |
1198 the offset is 0) or if the time zone is west of GMT. */ | |
1199 sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "+" : "-", | |
1196 abszone / (60*60), (abszone/60) % 60, abszone % 60); | 1200 abszone / (60*60), (abszone/60) % 60, abszone % 60); |
1197 tzstring = tzbuf; | 1201 tzstring = tzbuf; |
1198 } | 1202 } |
1199 else | 1203 else |
1200 invalid_argument ("Invalid time zone specification", Qunbound); | 1204 invalid_argument ("Invalid time zone specification", Qunbound); |