[local-time-devel] [PATCH] Make local-time operate correctly with timezones

Antoni Piotr Oleksicki apoleksicki at o2.pl
Sat Aug 8 14:05:40 UTC 2009


Hi Max,

2009/7/31 Max Tilford <maxtilford at gmail.com>:
> One issue we ran into though, was the timestamp+ function, which fails when
> it calls %offset-timestamp-part with the 'offset' keyword arg. I believe it
> should be using the 'utc-offset' keyword, but I don't know enough about the
> code to be sure. Could you confirm that?

Thanks for the bug report, it was that. Sorry for the delay, but
things were a bit busy. Anyway, here's the patch, as promised in the
earlier mail that accidentally didn't go to the list.

Cheers,
Antoni

=======================================================

Sat Aug  8 15:51:48 CEST 2009  Maciej Katafiasz <mathrick at gmail.com>
  * Minor bugfix: :utc-offset instead of :offset

New patches:

[Minor bugfix: :utc-offset instead of :offset
Maciej Katafiasz <mathrick at gmail.com>**20090808135148
 Ignore-this: e20b7cff5ec220a83bd112265b06f99f
] hunk ./src/local-time.lisp 889

 (defun timestamp+ (time amount unit &optional (timezone
*default-timezone*) offset)
   (multiple-value-bind (nsec sec day)
-      (%offset-timestamp-part time unit amount :timezone timezone
:offset offset)
+      (%offset-timestamp-part time unit amount :timezone timezone
:utc-offset offset)
     (make-timestamp :nsec nsec
                     :sec sec
                     :day day)))

Context:

[Make timestamp manipulation functions take and respect timezone arguments.
Maciej Katafiasz <mathrick at gmail.com>**20090727180103
 Ignore-this: 79214728e4966f44d8d4587bd850c53b
]
[Make WITH-DECODED-TIMESTAMP and related take timezone/offset arguments.
Maciej Katafiasz <mathrick at gmail.com>**20090727175400
 Ignore-this: 296084f8d9179fe257c69118b7123309
]
[Make ENCODE-TIMESTAMP accept timezones instead of fixed offsets.
Maciej Katafiasz <mathrick at gmail.com>**20090727174013
 Ignore-this: f6420e93d194396afb221821e1312652
]
[Use symbols instead of strings where possible.
Maciej Katafiasz <mathrick at gmail.com>**20090724164920]
[added a once failing test
attila.lendvai at gmail.com**20090616143818
 Ignore-this: 741ad01d47b47e15cb4877567d3ba9d9
]
[add a more useful error when find-timezone-by-location-name is used
without reading in the timezone files
attila.lendvai at gmail.com**20090616143733
 Ignore-this: c982ca27ef16e7f865afece963b6c9be
]
[fix (print (now)) when *timezone* is (find-timezone-by-location-name "UTC")
attila.lendvai at gmail.com**20090616141707
 Ignore-this: ac694826aa5e9719d41c51503e0a8785
]
[clean up gettimeofday stuff, follow sbcl's changes (but remain
backward compatible)
attila.lendvai at gmail.com**20090521170712
 Ignore-this: 70b2754c0a254abb060dce0f15bb266
]
[remove superfluous eval-when around reread-timezone-repository
attila.lendvai at gmail.com**20090513213236
 Ignore-this: 337cf4b3d50d0714f2c4a4a3d84e356f
]
[Local-time now passes all tests in CCL
Daniel Lowe <dlowe at bitmuse.com>**20090417142203]
[Changed lispworks/ccl kluge to another, better kluge
Daniel Lowe <dlowe at bitmuse.com>**20090417142156]
[In WITH-DECODED-TIMESTAMP, declare nsec type as ranged integer
instead of FIXNUM
Daniel Lowe <dlowe at bitmuse.com>**20090416204555]
[clarification comment for the lispworks #_ situation
attila.lendvai at gmail.com**20090324135651
 Ignore-this: 1f97d85c23ecffd5806f7a3c137f8491
]
[Less intrusive version of the Lispworks patch for #_.
Larry Clapp <larry at theclapp.org>**20090324132813

 Use an around method in ASDF's compile-op to set the readtable to ignore #_.
 This achieves the same end, but more elegantly, and doesn't pollute the
 regular readtable.
]
[be more conservative when installing global reader macros as a
lispwork workaround
attila.lendvai at gmail.com**20090323142133
 Ignore-this: dca64a6f7daa4d478beba41d1c102a16
]
[Work with Lispworks
Larry Clapp <larry at theclapp.org>**20090323132602

 - Added a dummy reader macro for #_ so the

     #+ccl
     (... #_gettimeofday ... )

   doesn't break the compile
 - Fix %unix-gettimeofday for Lisps other than CMU, SBCL, and CCL.
]
[TAG local-time-1.0.1
Daniel Lowe <dlowe at bitmuse.com>**20090312154109]
Patch bundle hash:
e73b3171e05766c85871c682974425fdfbebeb0a
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local-time.diff
Type: text/x-patch
Size: 3483 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/local-time-devel/attachments/20090808/f291ab21/attachment.bin>


More information about the local-time-devel mailing list