Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Contributor

@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.

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.

None yet

2 participants