Jump to content

Archived

This topic is now archived and is closed to further replies.

d_barszczak

Simple date problem

Recommended Posts

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???

Share this post


Link to post
Share on other sites
<?
$min=date("i")-5;
$date_now=date("h:$min:s");
echo $date_know;
?>

Share this post


Link to post
Share on other sites
$h=date("h");
$m=date("i")-5;
$s=date("s");

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


echo $date_now;

Share this post


Link to post
Share on other sites
Hi,

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

[code]

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

[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.