php-src icon indicating copy to clipboard operation
php-src copied to clipboard

strftime wrong result

Open tatdig opened this issue 4 years ago • 1 comments

Description

The following code:

echo strftime("%A, %e %B %G %R", strtotime('2022-01-01T11:20:00Z'))."\n";
<?php

Resulted in this output:

Saturday, 1 January 2021 11:20

But I expected this output instead:

Saturday, 1 January 2022 11:20

PHP Version

PHP 7.2.24

Operating System

Centos 8

tatdig avatar Jan 01 '22 12:01 tatdig

This is not a bug; %g and %G yield the ISO 8601 week-numbering year (which is suitable in combination with %V. You want to use %Y.

PHP 7.2.24

Consider to upgrade. We do not support this version anymore.

cmb69 avatar Jan 01 '22 12:01 cmb69