mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
* psycopg/typecast.c (typecast_parse_time): Fix up handling of
negative timezone offsets with a non-zero minutes field. * tests/test_dates.py (DatetimeTests): Add tests for time zone parsing. The test for HH:MM:SS time zones is disabled because we don't currently support it.
This commit is contained in:
parent
3466b3b72d
commit
ba8be438bb
|
@ -1,3 +1,12 @@
|
|||
2009-02-17 James Henstridge <james@jamesh.id.au>
|
||||
|
||||
* psycopg/typecast.c (typecast_parse_time): Fix up handling of
|
||||
negative timezone offsets with a non-zero minutes field.
|
||||
|
||||
* tests/test_dates.py (DatetimeTests): Add tests for time zone
|
||||
parsing. The test for HH:MM:SS time zones is disabled because we
|
||||
don't currently support it.
|
||||
|
||||
2009-02-16 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* FreeBSD now has round(). Modified config.h as suggested by
|
||||
|
|
|
@ -155,7 +155,7 @@ typecast_parse_time(const char* s, const char** t, Py_ssize_t* len,
|
|||
}
|
||||
if (t != NULL) *t = s;
|
||||
|
||||
*tz = tzs * tzhh*60 + tzmm;
|
||||
*tz = tzs * (tzhh * 60 + tzmm);
|
||||
|
||||
if (*us != 0) {
|
||||
while (usd++ < 6) *us *= 10;
|
||||
|
|
|
@ -136,7 +136,10 @@ class DatetimeTests(unittest.TestCase, CommonDatetimeTestsMixin):
|
|||
self.check_timezone(curs, "+01:15", 4500)
|
||||
self.check_timezone(curs, "-01:15", -4500)
|
||||
|
||||
def test_parse_datetime_timezone_hours_minutes_seconds(self):
|
||||
# This test is disabled because we don't support parsing second
|
||||
# resolution timezone offsets and Python wouldn't handle them even
|
||||
# if we did.
|
||||
def disabled_test_parse_datetime_timezone_hours_minutes_seconds(self):
|
||||
conn = psycopg2.connect(tests.dsn)
|
||||
curs = conn.cursor()
|
||||
self.check_timezone(curs, "+01:15:42", 4542)
|
||||
|
|
Loading…
Reference in New Issue
Block a user