Jump to content


Photo

Adding on time


  • Please log in to reply
2 replies to this topic

#1 ego0

ego0
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 September 2006 - 06:00 PM

How do I go about adding say 2 minutes onto the current time?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 08 September 2006 - 06:02 PM

Add 120 seconds.
<?php
$curtime = time();
$plus2min = $curtime + 120;
echo 'In 2 minutes it will be ' . date('g:i a',$plus2min);
?>

Ken

#3 ego0

ego0
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 September 2006 - 06:03 PM

Thats really simple. I was expecting this to be a very very complicated problem. Thanks :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users