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

Incorrect timestamp format for Postgresql #5612

Closed
meetraz opened this issue Aug 31, 2014 · 6 comments
Closed

Incorrect timestamp format for Postgresql #5612

meetraz opened this issue Aug 31, 2014 · 6 comments

Comments

@meetraz
Copy link

meetraz commented Aug 31, 2014

Postgresql's timestamps have millisecond resolution. This causes Carbon to throw an exception when hydrating postgresql timestamps. To correct, update this file

/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php

to contain this:

public function getDateFormat()
{
return 'Y-m-d H:i:s.u';
}

@Garbee
Copy link
Contributor

Garbee commented Aug 31, 2014

@meetraz If you know what to fix, just send in a pull request.

@meetraz
Copy link
Author

meetraz commented Aug 31, 2014

@Garbee, Sorry, I'm not really a git person, and it looks like a pretty complicated process to go through, for what is a very simple 2-3 line change. I hope this information can help somebody without me having to learn git.

@crynobone
Copy link
Member

Feel strange when no one else experiencing this issue. @taylorotwell himself use postgres for UserScape project without issue.

@barryvdh
Copy link
Contributor

barryvdh commented Sep 1, 2014

You can make changes and send pull request just by using the github Web interface. Just click on the edit button.

@lathspell
Copy link

I stumbled over this bug, too! I'm not very good with git but I managed to clone the project, apply the fix and create a pull request: #6673

I did not yet test if it works or creates any new bugs, though.

@meetraz
Copy link
Author

meetraz commented Dec 18, 2014

I issued a pull request also, #5623 but just like this ticket, it was ignored.

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

No branches or pull requests

6 participants