guile-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

timezone offsets


From: Aaron VanDevender
Subject: timezone offsets
Date: Thu, 22 Jun 2006 10:57:11 -0500

I notice that if I run:

$ guile -c '(display (strftime "%c %z\n" (localtime (current-time))))'
Thu Jun 22 10:51:21 2006 +0500

But I live at -0500 (CDT), not +500. The following patch fixes it:

Index: stime.c
===================================================================
RCS file: /sources/guile/guile/guile-core/libguile/stime.c,v
retrieving revision 1.108
diff -u -r1.108 stime.c
--- stime.c     17 Apr 2006 00:05:41 -0000      1.108
+++ stime.c     22 Jun 2006 15:53:13 -0000
@@ -498,7 +498,7 @@
   lt->tm_yday = scm_to_int (SCM_SIMPLE_VECTOR_REF (sbd_time, 7));
   lt->tm_isdst = scm_to_int (SCM_SIMPLE_VECTOR_REF (sbd_time, 8));
 #ifdef HAVE_TM_ZONE
-  lt->tm_gmtoff = scm_to_int (SCM_SIMPLE_VECTOR_REF (sbd_time, 9));
+  lt->tm_gmtoff = - scm_to_int (SCM_SIMPLE_VECTOR_REF (sbd_time, 9));
   if (scm_is_false (SCM_SIMPLE_VECTOR_REF (sbd_time, 10)))
     lt->tm_zone = NULL;
   else






reply via email to

[Prev in Thread] Current Thread [Next in Thread]