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

Replace deprecated gmstrftime with gmdate #2951

Merged

Conversation

elidrissidev
Copy link
Member

Description (*)

Replaces gmstrftime which is deprecated starting from PHP 8.1 with gmdate.

Fixed Issues (if relevant)

  1. Fixes Replace deprecated strftime and gmstrftime PHP functions #2030

Manual testing scenarios (*)

<?php

date_default_timezone_set('Europe/Amsterdam'); // GMT+1

echo date('Y-m-d H:i:s', mktime(0, 0, 0, 1, 1, 1998)) . PHP_EOL;
// > 1998-01-01 00:00:00 (from Europe/Amsterdam timezone)
echo gmdate('Y-m-d H:i:s', mktime(0, 0, 0, 1, 1, 1998)) . PHP_EOL;
// > 1997-12-31 23:00:00 (from UTC timezone)
echo gmstrftime("%Y-%m-%d %H:%M:%S", mktime(0, 0, 0, 1, 1, 1998)) . PHP_EOL;
// > 1997-12-31 23:00:00 (from UTC timezone)

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@elidrissidev elidrissidev added the PHP 8.1 Related to PHP 8.1 label Jan 16, 2023
@github-actions github-actions bot added the Component: ImportExport Relates to Mage_ImportExport label Jan 16, 2023
@elidrissidev
Copy link
Member Author

phpstan fails due to unrelated change (#2861).

@fballiano fballiano merged commit c891fac into OpenMage:1.9.4.x Jan 16, 2023
@fballiano
Copy link
Contributor

merged and cherrypicked to v20

@elidrissidev elidrissidev deleted the refactor/gmstrftime-to-gmdate branch January 16, 2023 16:40
justinbeaty pushed a commit to justinbeaty/magento-lts that referenced this pull request Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ImportExport Relates to Mage_ImportExport PHP 8.1 Related to PHP 8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deprecated strftime and gmstrftime PHP functions
3 participants