@weixuezhang opened this Issue on January 18th 2022

In reality we are accustomed to local time + local timezone. The factory method with UTC time + local timezone is really confusing. If it aims at creating a local time, the class should be changed to another name.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for Bugs)

1.
2.

Context

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:
@bx80 commented on January 19th 2022 Contributor

Hi @weixuezhang, thanks for raising this issue. I can understand why the Date::factory() parameters could cause confusion. This method is used extensively throughout the codebase and in plugins so it wouldn't be practical to rename it, but we could look at improving the method parameter names and the PHPDoc header to make it much clearer that the supplied date string should be in UTC.

Powered by GitHub Issue Mirror