Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-745

DateTime with SQLite

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Invalid
  • Affects Version/s: 2.0-ALPHA4
  • Fix Version/s: 2.x
  • Component/s: ORM
  • Security Level: All
  • Labels:
    None
  • Environment:
    Windows 7 - Portuguese Regional Settings
    XAMPP
    SQLite database

Description

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

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • Source
Hide
Permalink
Rui Lima added a comment - 12/Aug/10 9:28 AM

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.

Show
Rui Lima added a comment - 12/Aug/10 9:28 AM 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.
Hide
Permalink
Benjamin Eberlei added a comment - 12/Aug/10 5:01 PM

Does sqlite allow microseconds by default?

Show
Benjamin Eberlei added a comment - 12/Aug/10 5:01 PM Does sqlite allow microseconds by default?
Hide
Permalink
Rui Lima added a comment - 13/Aug/10 5:19 AM

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?

Show
Rui Lima added a comment - 13/Aug/10 5:19 AM 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?

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Rui Lima
Vote (0)
Watch (0)

Dates

  • Created:
    12/Aug/10 5:04 AM
    Updated:
    13/Aug/10 5:19 AM
    Resolved:
    12/Aug/10 9:28 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.