mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
1900 years shift fix.
This commit is contained in:
parent
86346579ba
commit
b17acddcf5
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user