Impossible to use MySQL's non-NULL Datetime #255

coviex opened this Issue Jan 10, 2012 · 0 comments


None yet
1 participant

coviex commented Jan 10, 2012


MySQL table has:

`done_at` datetime NOT NULL

AFAIK in Propel Datetime maps to timestamp.
So schema.yml has:

done_at: { type: timestamp }

Result is:

  DateTime::__construct(): Failed to parse time string (0) at position 0 (0): Unexpected character 

when I try to setDoneAt() on model with empty ('0000-00-00 00:00:00') property.
Error seems to be in setDoneAt() in line:

$currentDateAsString = ($this->checked_at !== null && $tmpDt = new DateTime($this->checked_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;


PS initially this was my report to propelorm/sfPropelORMPlugin#103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment