Jump to content


Photo

PHP Time


  • Please log in to reply
2 replies to this topic

#1 snaps

snaps
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 August 2006 - 08:12 PM

Hi, I'm a newb in php but I want to change the time with one hour less

Heres the code:

fwrite($datei, $uniqid."|".time()."|".$_SERVER["REMOTE_ADDR"]."|".$_POST['comment_id']."|".$name."|".$email_hp."|".$comment_text."\n");


I tried time()-3600, wont work :-[

Please help

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 08 August 2006 - 08:21 PM

put time() - 3600 in parenthesis

fwrite($datei, $uniqid."|". (time() - 3600) ."|".$_SERVER["REMOTE_ADDR"]."|".$_POST['comment_id']."|".$name."|".$email_hp."|".$comment_text."\n");

You need to know your operator precedence to know that...
follow me on twitter @PHPsycho

#3 snaps

snaps
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 August 2006 - 09:04 PM

Works now, thk :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users