Link to home
Start Free TrialLog in
Avatar of gmailrules
gmailrules

asked on

time not updating

$date = date("Y-m-d h:m:s");

the date is correct but the time is not updating.  $date could be, 2004-11-18 02:11:00 and 5 min later, running the script again, it will still be 2004-11-18 02:11:00

Any Ideas?
Avatar of Diablo84
Diablo84

Nothing wrong with that code:

 $date = date("Y-m-d h:m:s");
 echo $date;

Is it possible that you are referencing a static string or database field accidently, eg. if you have a date stored in a string assigned to a variable.

Or perhaps your server clock has mysteriously frozen :)


If you could post a little more code if in doubt...
Avatar of gmailrules

ASKER

found out the problem :D

 $date = date("Y-m-d h:m:s"); should be  $date = date("Y-m-d h:i:s");
good spot :)

Ran the code on my box saw the seconds updating and overlooked the minutes.

Best Wishes
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial