.. _structures-datetimepreference: .. _date()-versus-datetime-preference: date() versus DateTime Preference +++++++++++++++++++++++++++++++++ Processing dates is done with `date() `_ functions or `DateTime `_>`_ classes. In the `date() `_ team, there are the following functions : `date() `_, `time() `_, `getdate() `_, `localtime() `_, `strtotime() `_, `strptime() `_, `gmdate() `_, `strftime() `_, `mktime() `_, gmktime(). In the `DateTime `_>`_ team, there are the instantiation of `DateTime `_>`_ and `DateTimeImmutable `_>`_; the DateTime\:\:createFromInterface(), `DateTime\:\:createFromFormat() `_, DateTime\:\:createFromImmutable() and DateTime\:\:createFromMutable(). The analyzed code has less than 10% of one of them : for consistency reasons, it is recommended to make them all the same. .. code-block:: php Specs _____ +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/DateTimePreference | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`Changed Behavior `, :ref:`Preferences ` | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.4.9 | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Features | date | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+