Jump to content


Photo

Simple date problem


  • Please log in to reply
4 replies to this topic

#1 d_barszczak

d_barszczak
  • Members
  • PipPipPip
  • Advanced Member
  • 188 posts
  • LocationBradford - UK

Posted 26 July 2006 - 10:53 AM

I know this is such a simple problem as i have done it in the past and also seen it here but can't remember how i did it and cant seem to find it here.

Basically i have a $datenow = date("U") and i would like to minus 5 minutes from this.

Does anybody know how???

When all else fails - Try reading the manual.

Integrated IT Systems Ltd


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 July 2006 - 10:57 AM

<?
$min=date("i")-5;
$date_now=date("h:$min:s");
echo $date_know;
?>
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 d_barszczak

d_barszczak
  • Members
  • PipPipPip
  • Advanced Member
  • 188 posts
  • LocationBradford - UK

Posted 26 July 2006 - 10:59 AM

ok,

if date("i") is say 1 this wont give me -4 will it?

When all else fails - Try reading the manual.

Integrated IT Systems Ltd


#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 July 2006 - 11:09 AM

$h=date("h");
$m=date("i")-5;
$s=date("s");

$date_now=date("$h: $m: $s");


echo $date_now;
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 d_barszczak

d_barszczak
  • Members
  • PipPipPip
  • Advanced Member
  • 188 posts
  • LocationBradford - UK

Posted 26 July 2006 - 11:19 AM

Hi,

That method don't work but sorted it now anyway.


$min = date("U")-60*5;
echo date("g:i:s A");
echo "<br>";
echo date("g:i:s A", $min)


When all else fails - Try reading the manual.

Integrated IT Systems Ltd





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users