Skip to content

Fixed PHP 8.1: strftime and gmstrftime functions are deprecated#799

Open
raortegar wants to merge 1 commit intosimplepie:masterfrom
raortegar:fix_strftime_deprecation
Open

Fixed PHP 8.1: strftime and gmstrftime functions are deprecated#799
raortegar wants to merge 1 commit intosimplepie:masterfrom
raortegar:fix_strftime_deprecation

Conversation

@raortegar
Copy link

@raortegar raortegar commented Feb 21, 2023

According to the PHP 8.1 documentation the use of strftime fucntion is deprecated. See this link for more information:
https://php.watch/versions/8.1/strftime-gmstrftime-deprecated
https://www.php.net/manual/en/function.strftime.php

Copy link
Member

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Unfortunately, the date function accepts a different format, even the default value of the $date_format argument is not supported (compare the tables for DateTime::format and strftime).

I would suggest deprecating get_local_date method and adding get_date_raw(): ?string and get_datetime(): ?DateTime methods, corresponding to the first and second if branches, respectively. The local formatting would then be a responsibility of the consumer.

@Art4 Art4 added this to the 1.9.0 milestone Sep 30, 2024
@jtojnar jtojnar mentioned this pull request Aug 15, 2025
7 tasks
@Art4 Art4 modified the milestones: 1.9.0, 1.10.0 Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants