mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-745: DateTime with SQLite #921
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Aug 12, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user darkfly:
I was using 2.0.0-Beta3 no problems found.
Then upgraded to Beta4 and the following:
Fatal error: Uncaught exception 'Doctrine\DBAL\Types\ConversionException' with message 'Could not convert database value "2010-08-07 00:00:00.000" to Doctrine Type datetime' in
I guess it's an ORM's problem.
I've traced to:
call stack:
Doctrine\DBAL\Types\DateTimeType->convertToPHPValue()
Doctrine\ORM\Persisters\BasicEntityPersister->_processSQLResult()
Doctrine\ORM\Persisters\BasicEntityPersister->_createEntity()
Doctrine\ORM\Persisters\BasicEntityPersister->load()
Doctrine\ORM\Persisters\BasicEntityPersister->findOneBy()
in Doctrine\DBAL\Types\DateTimeType->convertToPHPValue() i receive the values:
$value = "2010-08-07 00:00:00.000"
$platform->getDateTimeFormatString() = "Y-m-d H:i:s"
I'm new to Doctrine, maybe is my problem but it was working before i've upgraded everything.
I'll also try to find out what is going on, but just to let you guys know.
=================0
System:
Windows 7 - Portuguese Regional Settings
XAMPP
SQLite database
@doctrinebot commented on GitHub (Aug 12, 2010):
Comment created by darkfly:
I took a closer look to my problem.
I used and external tool to update the field, and instead of '2010-08-07 00:00:00' the tool inserted '2010-08-07 00:00:00.000'
So, there is no problem.
Thanks and sorry.
@doctrinebot commented on GitHub (Aug 12, 2010):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Aug 12, 2010):
Comment created by @beberlei:
Does sqlite allow microseconds by default?
@doctrinebot commented on GitHub (Aug 13, 2010):
Comment created by darkfly:
I don't quite understand you question.
both of the following works:
update tb_user set registerdate='2010-08-07 00:00:00'
update tb_user set registerdate='2010-08-07 00:00:00.000'
And here: http://www.sqlite.org/lang_datefunc.html
we can see that YYYY-MM-DDTHH:MM:SS.SSS is one of the supported formats.
On other hand when i execute:
select DATETIME('NOW') --//->2010-08-13 09:14:21
So i guess the default is with no miliseconds.
Could we make possible to specify the datetime format in the annotation reference?