Fixed PHP 8.1: strftime and gmstrftime functions are deprecated#799
Open
raortegar wants to merge 1 commit intosimplepie:masterfrom
Open
Fixed PHP 8.1: strftime and gmstrftime functions are deprecated#799raortegar wants to merge 1 commit intosimplepie:masterfrom
raortegar wants to merge 1 commit intosimplepie:masterfrom
Conversation
jtojnar
requested changes
Feb 21, 2023
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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