Skip to content

Laravel + Postgresql timestamp with timezone #15

@EspadaV8

Description

@EspadaV8

Using Postgres timestamp with time zone column with Laravel causes an issue with Carbon

InvalidArgumentException in Carbon.php line 414:
Trailing data

This is because the data returned by Postgres include the +00 timezone information on the end. One fix would be to override getDateFormat and have it return 'Y-m-d H:i:sO' but of course we'd only want to do that where timezones are being used.

Models can override their own dateFormat property, but pivot tables with timestamps can't do this (since there's no actual model for them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions