<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 09:04:40 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-102/DBAL-102.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-102] SQLSRV PDO doesn&apos;t support DateTime as a PHP Object</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-102</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;I have created an entity with has a datetime column&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Entity.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    /**
     * @orm:Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;deleteAt&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $deletedAt;

    /**
     * Get DeletedAt
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;	\DateTime	
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDeletedAt() {
    	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;deletedAt;
    }
    
    /**
     * Set DeletedAt
     * @param	\DateTime		$deletedAt
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setDeletedAt(\DateTime $deletedAt) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;deletedAt = $deletedAt;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;This should work, however I get this error when trying to set a &quot;deleteAt&quot; date&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setDeletedAt(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[22007]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This should work afaik.&lt;/p&gt;</description>
                <environment>Windows 7, Microsoft SQL Server 2008, PHP SqlSrv Driver 2.0, PHP 5.3.6</environment>
            <key id="12476">DBAL-102</key>
            <summary>SQLSRV PDO doesn&apos;t support DateTime as a PHP Object</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="aarondm">Aaron DM</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Mar 2011 01:27:03 +0000</created>
                <updated>Fri, 15 Mar 2013 08:31:08 +0000</updated>
                    <resolved>Wed, 14 Sep 2011 17:22:01 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15552" author="beberlei" created="Mon, 21 Mar 2011 06:00:23 +0000"  >&lt;p&gt;Are yo using columns of type &quot;datetime&quot; or &quot;datetime2&quot; in MSSQL? The former is not supported.&lt;/p&gt;</comment>
                    <comment id="15563" author="aarondm" created="Mon, 21 Mar 2011 12:29:56 +0000"  >&lt;p&gt;I did not know datetime was not supported. I am using the column type &quot;datetime&quot;&lt;/p&gt;</comment>
                    <comment id="15564" author="beberlei" created="Mon, 21 Mar 2011 15:06:23 +0000"  >&lt;p&gt;In this case you have to add your own datetime type and change the timestamp format, or use the VarDateTime instead by calling &quot;overrideType&quot;. Have a look at the Doctrine\DBAL\Types folder, escpecially the Type.php, DateTimeType.php and VarDateTimeType.php&lt;/p&gt;</comment>
                    <comment id="15631" author="aarondm" created="Tue, 29 Mar 2011 15:01:36 +0000"  >&lt;p&gt;I have now tried this with the column type &quot;datetime2&quot;, which creates the following  date format in the database&lt;br/&gt;
&quot;2011-03-27 06:07:00.000000&quot;&lt;/p&gt;

&lt;p&gt;And I am still getting the same error&lt;br/&gt;
&quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22007&amp;#93;&lt;/span&gt;: &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Conversion failed when converting date and/or time from character string.&quot;&lt;/p&gt;

&lt;p&gt;P.S. this time I tried doing a select&lt;br/&gt;
WHERE deletedAt &amp;gt; (datetime)&lt;/p&gt;</comment>
                    <comment id="15632" author="beberlei" created="Tue, 29 Mar 2011 15:13:23 +0000"  >&lt;p&gt;Assigned to juokaz&lt;/p&gt;</comment>
                    <comment id="15633" author="aarondm" created="Tue, 29 Mar 2011 15:14:11 +0000"  >&lt;p&gt;When i ran profile, this is what I see&lt;/p&gt;

&lt;p&gt;&quot; AND (a0_.deleted_at &amp;lt;= @P3) ORDER BY a0_.deleted_at DESC&apos;,&apos;810678&apos;,&apos;Object&apos;,&apos;Object&apos;&quot;&lt;/p&gt;

&lt;p&gt;Expliclitly converting the DateTiem to a string works&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;setParameter(&quot;deletedAt&quot;, $deletedAt-&amp;gt;format(&quot;Y-m-d H:i:s.u&quot;));&lt;/p&gt;</comment>
                    <comment id="15635" author="juokaz" created="Tue, 29 Mar 2011 17:22:47 +0000"  >&lt;p&gt;Can you give a full code which you use to query this (or the smallest allowing to replicate). I can&apos;t see how DateTime object gets passed as a &apos;Object&apos; to the query, this is handled by DBAL type system, not by mssql platform, which only specifies the date and/or time format. &lt;/p&gt;</comment>
                    <comment id="15638" author="beberlei" created="Wed, 30 Mar 2011 04:24:27 +0000"  >&lt;p&gt;Does the error happen during a DQL or during flush (UPDATE/INSERT) ?&lt;/p&gt;</comment>
                    <comment id="15642" author="aarondm" created="Wed, 30 Mar 2011 16:44:52 +0000"  >&lt;p&gt;&lt;a href=&quot;https://gist.github.com/6b2a8b53ece6e75abf20&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/6b2a8b53ece6e75abf20&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code there works (its not fully complete, but I tested the statements with the same Entity and etc and I am unable to successfully query the database).&lt;/p&gt;

&lt;p&gt;Looks like it doesn&apos;t work even for a simple select. However if I do retrieve an entry, the getCreatedAt() does return a DateTime object correctly.&lt;/p&gt;</comment>
                    <comment id="16463" author="guilhermeblanco" created="Tue, 13 Sep 2011 04:44:02 +0000"  >&lt;p&gt;Is this issue still valid with new implementation of ParameterTypeInferer in ORM?&lt;/p&gt;

&lt;p&gt;It seems it solved this issue.&lt;/p&gt;</comment>
                    <comment id="16471" author="guilhermeblanco" created="Wed, 14 Sep 2011 17:22:01 +0000"  >&lt;p&gt;Closing since no response was given.&lt;/p&gt;</comment>
                    <comment id="19863" author="bunny1985" created="Fri, 15 Mar 2013 08:15:38 +0000"  >&lt;p&gt;Why is it close ? After one day of waiting for response? &lt;br/&gt;
Problem is not solved. It exist on ether datetime and datetime2 TSQL types. &lt;br/&gt;
And it is easy to check if you have sqlserver databes.&lt;br/&gt;
PLease repoen this issue. &lt;/p&gt;</comment>
                    <comment id="19864" author="ocramius" created="Fri, 15 Mar 2013 08:31:08 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=bunny1985&quot; class=&quot;user-hover&quot; rel=&quot;bunny1985&quot;&gt;Micha&#322; Bana&#347;&lt;/a&gt; this actually works with the current implementation of the schema tools. Consider implementing additional formats a custom DBAL type instead.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>