Page 1 of 1

Help regarding errors and date function

Posted: Wed Aug 11, 2010 12:44 pm
by vaibh.14k
Hello,
I ve 2 problems :

I ve PHP 5.2.6 and Apache 2.2.15 on Win7 (32 bit).

1)

I am unable to see error messages when i commit a mistake in syntax.

Ex: if i miss out a ";" after an echo statement or if i write mysql_connecti instead of proper syntax,i JUST GET a blank page without any of the code line being executed.I want to see error messages so that debugging becomes easy in a large file.

2)

To display the time of system and date i use:

echo "Today's Date is: ".date("d/m/Y")."<br><br>";
echo "Current time is: ".date("H:i:s")."<br><br>";

And this is what is get:

(Checked at 21:09 on 10/08/2010)

Today's Date is: 10/08/2010
Current time is: 15:26:47

The date is proper But the time being shown is different from expected(21:09).
I will be implementing this time to record the logged in time of a user on my site.so i need to determine the time properly.

any input will be appreciated.

thanks in advance.

-amit

Re: Help regarding errors and date function

Posted: Wed Aug 11, 2010 12:49 pm
by Gargoyle
#1
you probably turned off error messages. check this out:
http://www.thelampblog.com/2009/12/28/p ... ors-onoff/

#2
you can set the default time zone by putting:

Code: Select all

date_default_timezone_set('GMT')