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 /psycopg/adapter_datetime.c | |
parent | 86346579ba2969c9003b8f635fc08ba63c3389e5 (diff) | |
download | psycopg2-b17acddcf59cd150c32013485039fb9339edeafb.tar.gz |
1900 years shift fix.
Diffstat (limited to 'psycopg/adapter_datetime.c')
-rw-r--r-- | psycopg/adapter_datetime.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |