Skip to content

Date output in formatGregorian() does not have zero padding for month/day #182

@fa-modabber

Description

@fa-modabber

Thank you for this great package. I noticed that the date output of formatGregorian() function does not have leading zeros for month and day. For example the output of below code is "2025-9-22 17:26:00" instead of "2025-09-22 17:26:00"

Verta::parse($date)->formatGregorian('Y-n-j H:i:s')

This causes issues when validating with Laravel’s date_format:Y-m-d H:i:s rule or when parsing with Carbon, since they expect zero-padded values.

It would be better if the package always returns dates in standard zero-padded format (Y-m-d H:i:s) for better compatibility.

Thanks 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions