Skip to content

Return wrong date form date_create_from_format #17631

@ThomasLoSG

Description

@ThomasLoSG

Description

The following code:

<?php
$date=date_create_from_format("M-Y","Feb-2024");
echo date_format($date,"Y/m/d");

Resulted in this output:
2024/03/01


But I expected this output instead:
2024/02/29

PHP Version

PHP 8.3.4

Operating System

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions