Jump to content


Photo

Subtracting time


  • Please log in to reply
2 replies to this topic

#1 Andrew R

Andrew R
  • Members
  • PipPipPip
  • Advanced Member
  • 158 posts
  • LocationIreland

Posted 14 October 2006 - 09:41 PM

Hi

How would I subtract 1 hour from this time function
$time = date('H:i');

Cheers  :)


#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 14 October 2006 - 09:59 PM

<?php

$time = date("H:i", time()-60*60);

?>

Check the date() function for further info :)

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 Andrew R

Andrew R
  • Members
  • PipPipPip
  • Advanced Member
  • 158 posts
  • LocationIreland

Posted 14 October 2006 - 10:04 PM

Thanks very much  :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users