php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78120 No more warning for missing timezone
Submitted: 2019-06-06 11:55 UTC Modified: 2019-06-06 12:52 UTC
From: laurent dot lyaudet at gmail dot com Assigned:
Status: Verified Package: Date/time related
PHP Version: 7.0.0 OS: Debian 9.7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-06-06 11:55 UTC] laurent dot lyaudet at gmail dot com
Description:
------------
---
From manual page: https://php.net/function.date-default-timezone-set
---
The documentation contains
"
    Note:

    Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.
"
However, I don't have any warning issued when I run the function date without timezone on Debian 9.7.

root@StretchDevNewLaurent:/home/web/teliway.com/appli# 
  grep -r 'date.timezone' /etc/php/7.0/
/etc/php/7.0/apache2/php.ini:; http://php.net/date.timezone
/etc/php/7.0/apache2/php.ini:;date.timezone =
/etc/php/7.0/phpdbg/php.ini:; http://php.net/date.timezone
/etc/php/7.0/phpdbg/php.ini:;date.timezone =
/etc/php/7.0/cli/php.ini:; http://php.net/date.timezone
/etc/php/7.0/cli/php.ini:;date.timezone =




Test script:
---------------
<?php
echo date('Ymd');
1/0;
?>
20190606PHP Warning:  Division by zero in - on line 3
PHP Stack trace:
PHP   1. {main}() -:0

Warning: Division by zero in - on line 3

Call Stack:
   21.1228     344160   1. {main}() -:0




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-06 12:52 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Date/time related -PHP Version: 7.1.30 +PHP Version: 7.0.0
 [2019-06-06 12:52 UTC] cmb@php.net
Indeed, there is no longer any warning as of PHP 7.0.0[1].  The
notice for invalid timezones is still issued, though.

[1] <https://www.php.net/manual/en/migration70.other-changes.php#migration70.other-changes.remove-date-timezone-warning>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 07:01:26 2019 UTC