Subject | save and retrive datetime data type |
---|---|
Author | |
Post date | 2018-04-23T16:10:25Z |
Hi,
I'm working with fdb 1.8 and firebird 2.5. I get any behavior that confuse me, maybe I'm misunderstanding something.
I have a datetime python object with microsecond precisions on it. Inserting this into a table and when retrive the inserted record I lost the microsecond precision (firebird works with milliseconds, right?)
Example:
The original microsecond was 321.
So, I need explicit datatype conversion or work datetime as string wirh microsecond to millisecond replacement?
Is a bug?
Is a feature?
Regards
Maxi
I'm working with fdb 1.8 and firebird 2.5. I get any behavior that confuse me, maybe I'm misunderstanding something.
I have a datetime python object with microsecond precisions on it. Inserting this into a table and when retrive the inserted record I lost the microsecond precision (firebird works with milliseconds, right?)
Example:
>> d = datetime.datetime(2015, 6, 15, 14, 30, 50, 321)321
>>> d.microsecond
>> sql = "INSERT INTO DB_FUNCTIONS_DTMODEL (ID, NAME, START_DATETIME) VALUES (?, ?, ?)"Where START_DATETIME is TIMESTAMP field.
>> cur.execute(s, (None, 'test4', d))(320, 'test1', datetime.datetime(2015, 6, 15, 14, 30, 50, 300))
>> cur.execute("SELECT r.ID, r.NAME, r.START_DATETIME FROM DB_FUNCTIONS_DTMODEL r")
>> r = cur.fetchone()
>> r
>>> r[2].microsecond300
The original microsecond was 321.
So, I need explicit datatype conversion or work datetime as string wirh microsecond to millisecond replacement?
Is a bug?
Is a feature?
Regards
Maxi