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

PgInterval error #23

Open
chanmix51 opened this issue Mar 2, 2015 · 5 comments
Open

PgInterval error #23

chanmix51 opened this issue Mar 2, 2015 · 5 comments
Labels

Comments

@chanmix51
Copy link
Member

Data 'PT-11H-26M-27.454181S' is not an ISO8601 interval representation.

@chanmix51 chanmix51 added the bug label Mar 2, 2015
@stood
Copy link
Member

stood commented Mar 3, 2015

@chanmix51 chanmix51 added wontfix and removed bug labels Mar 3, 2015
@chanmix51
Copy link
Member Author

Yes, it seems PHP is lacking the representation of negative intervals. Even though there is a invert flag, it makes the PgInterval to store the absolute value and adds a negative sign at the end. This does not make PHP able to support interval representations like 2 days - 2 hours which Postgresql supports.

This is a PHP issue, not a Pomm issue. Maybe it is somehow interesting to find a solution to have a fallback in case of such issue.

@krichprollsch
Copy link

Hello,
I encounter this issue a lot in my use case :/
I understand the bug come from php, but do you have any idea of a workaround I could implement?
Thank you <3

@chanmix51
Copy link
Member Author

What can be done from our side, is to support any classes that inherits from DateInterval. This way, you could implement your own DateInteval class that would feature negative date intervals.

@chanmix51 chanmix51 reopened this Sep 15, 2017
@zecho
Copy link

zecho commented Oct 3, 2017

I have this issue in few places. I do date_trunc('second', field) to ensure there will be no floating point time. It's a dirty hack but until PHP implement it we can't do a lot more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants