Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed DateType when unixtimestamp is given (ie. time()) #20

Closed
wants to merge 1 commit into from

Conversation

pgodel
Copy link
Contributor

@pgodel pgodel commented Oct 5, 2010

If value comes from using time() an error will occur:

exception (Exception) in /usr/local/sgcontrol2_dev/src/vendor/doctrine-mongodb/lib/Doctrine/ODM/MongoDB/Mapping/Types/DateType.php on line 47: DateTime::__construct(): Failed to parse time string (1286245836) at position 7 (8): Unexpected character

DateTime() does not seem to handle unix timestamps directly.

Checking if value is numeric should do the trick. Also doing elseif will prevent useless conditions if timestamp was already set.

@avalanche123
Copy link
Contributor

fix coding standards please:)

@pgodel
Copy link
Contributor Author

pgodel commented Oct 5, 2010

sorry about that, Netbeans was misconfigured.

jmikola added a commit that referenced this pull request Apr 2, 2013
Alternative syntax (embed & reference) example for the yml-mapping reference
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants