time() function

soulvayne

New member
Joined
Apr 17, 2008
Messages
2
When i place the time() function in my site it works but it doesnt display the time right . im using it in a guestbook, if i post a message @ 10:30 it displays 11:30 for example. I don't know if its a setting in phpmyadmin or directadmin.
It would be great if you could help me ^^
Tnx in advance.


Here's the code im using:

PHP:
<?php

if(!empty($_POST["submit"]))
{
   $wie = $_POST["wie"];
   $wat = $_POST["wat"];
   $datum = date("y-m-d", time());
   $tijd = date("H:i:s",time());
   $query = "insert into gastenboek values ('".$wie."', '".$wat."','".$datum."','".$tijd."');";
   $result = mysql_query($query);
   if ((mysql_error()!=""))
   {
	      $ANTW = mysql_error();
	      echo ("oorzaak van de fout: " . $ANTW);
	}
}
?>
 
Can i ask how... ive googled some and tried some things but none i seem to try does work.

plz help ^^
 
Do you get correct time when you execute "date" in ssh? If not - create a symlink from your timezone (e.g. /usr/share/zoneinfo/Europe/Vilnius) to /etc/localtime.

Code:
ln -sf /usr/share/zoneinfo/Europe/Vilnius /etc/localtime
 
Back
Top