473,385 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

what is the meaning of this?

the code below...
-------------------------------
<?
function errorHandler($errno, $str, $file, $line)
{
//if ($errno == E_STRICT) return;
fwrite(STDERR, "\n\n$errno: $str\n\n");
if ($errno == E_USER_ERROR) die();
}
set_error_handler('errorHandler');

$a = mktime(14, 0, 0, 12, 20, 2005);
echo date('d/m/Y', $a);
?>
-------------------------------
....produces this STDERR...
-------------------------------
2048: mktime(): It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment
variable or the date_default_timezone_set() function. We selected
'Europe/Helsinki' for '2.0/no DST' instead
2048: date(): It is not safe to rely on the system's timezone settings.
Please use the date.timezone setting, the TZ environment variable or the
date_default_timezone_set() function. We selected 'Europe/Helsinki' for
'2.0/no DST' instead
-------------------------------
What is the meaning of this message?
How can I silence it without commenting the commented line?

Thanks
Dec 11 '05 #1
2 5116
Chameleon wrote:
What is the meaning of this message?
How can I silence it without commenting the commented line?


Your server could be located in America, while your application is focussed
on European users, which can produce errors with date/time related
operations.

The fix is to follow the instruction and to apply the
date_default_timezone_set() function:

date_default_timezone_set('UTC');
$a = mktime(14, 0, 0, 12, 20, 2005);
echo date('d/m/Y', $a);

Instead of UTC, you can use any of the ones listed on the following page:

http://www.php.net/manual/en/timezones.php
JW
Dec 11 '05 #2
Chameleon wrote:
the code below...
-------------------------------
<?
function errorHandler($errno, $str, $file, $line)
{
//if ($errno == E_STRICT) return;
fwrite(STDERR, "\n\n$errno: $str\n\n");
if ($errno == E_USER_ERROR) die();
}
set_error_handler('errorHandler');

if (PHP_VERSION >= '5.1.0RC1')
date_default_timezone_set('Europe/Helsinki');
$a = mktime(14, 0, 0, 12, 20, 2005);
echo date('d/m/Y', $a);
?>
-------------------------------
...produces this STDERR...
-------------------------------
<snip>
What is the meaning of this message?
How can I silence it without commenting the commented line?


Dec 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: jinal jhaveri | last post by:
Hi All, I have one question regarding circular inheritance I have 3 files 1) A.py , having module A and some other modules 2) B.py having module B and some other modules 3) C.py having...
112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
17
by: candy_init | last post by:
I sometimes comes across statements which invloves the use of size_t.But I dont know exactly that what is the meaning of size_t.What I know about it is that it is used to hide the platform...
7
by: KevinLee | last post by:
I found that the STL.NET published with VS Beta2, but what is the meaning of STL.NET. Is it just a simple wrapper to replace the old std stl? I can find nothing new but the keyword 'Generate' to...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
132
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
4
by: Virtual_X | last post by:
it's only language confusion i am non-english speaker so i heard about stream in alot of c++ tutorials ie: in iostream and in sstream headers in sstream we use the class stringstream to...
5
by: =?Utf-8?B?Sm9seW5pY2U=?= | last post by:
Hi everyone, I am learning c# and i don´t understand a piece of code , can anyone explain the meaning of this code please. public class vector { public double? R = null; //I suppose this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.