diff options
author | Federico Di Gregorio <fog@initd.org> | 2005-07-21 08:36:55 +0000 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2005-07-21 08:36:55 +0000 |
commit | b17acddcf59cd150c32013485039fb9339edeafb (patch) | |
tree | a22a827d3a331bd447a122ed166acf67877de9b9 | |
parent | 86346579ba2969c9003b8f635fc08ba63c3389e5 (diff) | |
download | psycopg2-b17acddcf59cd150c32013485039fb9339edeafb.tar.gz |
1900 years shift fix.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | psycopg/adapter_datetime.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2005-07-21 Federico Di Gregorio <fog@debian.org> + + * psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900 + years offset reported by Jeroen van Dongen (see ticket #33). + 2005-07-17 Federico Di Gregorio <fog@debian.org> * Release 2.0 beta 4. diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index 656e14f..1afcb0c 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -338,7 +338,7 @@ psyco_DateFromTicks(PyObject *self, PyObject *args) t = (time_t)round(ticks); if (gmtime_r(&t, &tm)) { - args = Py_BuildValue("iii", tm.tm_year, tm.tm_mon+1, tm.tm_mday); + args = Py_BuildValue("iii", tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday); if (args) { res = psyco_Date(self, args); Py_DECREF(args); @@ -383,7 +383,7 @@ psyco_TimestampFromTicks(PyObject *self, PyObject *args) t = (time_t)round(ticks); if (gmtime_r(&t, &tm)) { args = Py_BuildValue("iiiiid", - tm.tm_year, tm.tm_mon+1, tm.tm_mday, + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, (double)tm.tm_sec); if (args) { res = psyco_Timestamp(self, args); |