php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52633 Date() / mktime() function were generating error ..
Submitted: 2010-08-18 10:51 UTC Modified: 2010-08-18 11:03 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: avani at aspl dot in Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.3 OS: FC11
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: avani at aspl dot in
New email:
PHP Version: OS:

 

 [2010-08-18 10:51 UTC] avani at aspl dot in
Description:
------------
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /PATH/nf_common.inc on line 162

Test script:
---------------
<?php 

echo $c=date('Y');

?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-18 10:53 UTC] avani at aspl dot in
-Summary: this function was generating error .. +Summary: Date() / mktime() function were generating error ..
 [2010-08-18 10:53 UTC] avani at aspl dot in
mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /PATH/nf_statCounter.inc on line 21
 [2010-08-18 11:03 UTC] aharvey@php.net
-Status: Open +Status: Bogus -Package: *General Issues +Package: Date/time related
 [2010-08-18 11:03 UTC] aharvey@php.net
This isn't a bug: the error message explains exactly what's happening and what you need to do to fix it. Please follow it up with a support channel if you're still unclear on the problem.
 [2010-09-08 22:22 UTC] anton85s at mail dot ru
IT IS a bug, because PHP is NOT an operating system, it is just a software package, and it should not require the OS user to set the timezone settings each time in each application he/she is going to change it. Most not-time-specialized software packages should rely on system settings and should not require the user to change it all manually.
For example, user John moves with his laptop from one timezone to another each 2 days. He has 100 software packages installed in his laptop, and he should be able to change the timezone _only_ by modifying the system settings once, not 101 times each time he changes the timezone.
Therefore, such warning is certainly erroneous and is an actual bug which has to be fixed.
The correct way to do it is to implement a separate setting in ini file or elsewhere whether time and date functions should rely on application-specific time settings or system time settings.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 05:01:30 2024 UTC