Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>My point is that I just want the raw DATETIME string, so I can parse it myself as is.</p> </blockquote> <p>That makes me think that your "workaround" is not a workaround, but in fact the only way to get the value from the database into your code:</p> <pre><code>SELECT CAST(add_date AS CHAR) as add_date </code></pre> <p>By the way, some more notes from the MySQL documentation:</p> <p>MySQL <a href="http://dev.mysql.com/doc/refman/5.0/en/constraint-invalid-data.html" rel="noreferrer">Constraints on Invalid Data</a>:</p> <blockquote> <p>Before MySQL 5.0.2, MySQL is forgiving of illegal or improper data values and coerces them to legal values for data entry. In MySQL 5.0.2 and up, that remains the default behavior, but you can change the server SQL mode to select more traditional treatment of bad values such that the server rejects them and aborts the statement in which they occur.</p> <p>[..]</p> <p>If you try to store NULL into a column that doesn't take NULL values, an error occurs for single-row INSERT statements. For multiple-row INSERT statements or for INSERT INTO ... SELECT statements, MySQL Server stores the implicit default value for the column data type.</p> </blockquote> <p>MySQL 5.x <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.html" rel="noreferrer">Date and Time Types</a>:</p> <blockquote> <p>MySQL also allows you to store '0000-00-00' as a “dummy date” (if you are not using the NO_ZERO_DATE SQL mode). This is in some cases more convenient (and uses less data and index space) than using NULL values.</p> <p>[..]</p> <p>By default, when MySQL encounters a value for a date or time type that is out of range or otherwise illegal for the type (as described at the beginning of this section), it converts the value to the “zero” value for that type.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload