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

strftime deprecation will break get_local_date #864

Open
npr-gh opened this issue Apr 29, 2024 · 1 comment
Open

strftime deprecation will break get_local_date #864

npr-gh opened this issue Apr 29, 2024 · 1 comment

Comments

@npr-gh
Copy link

npr-gh commented Apr 29, 2024

strftime is deprecated and will be removed once PHP9 comes out.

This function is currently exposed via effectively a thin wrapper; the get_local_date function within Item.php

 public function get_local_date($date_format = '%c')
        {
                if (!$date_format)
                {
                        return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);
                }
                elseif (($date = $this->get_date('U')) !== null && $date !== false)
                {
                        return strftime($date_format, $date);
                }

                return null;
        }

Unfortunately the replacements (datetime.format which allows for explicit formatting or intldateformatter.format which will take a DateTime and a Locale and format it correctly for you) do not have compatible format signatures.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 29, 2024

See #799 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants