Page 1 of 1

now()

Posted: Wed Nov 19, 2003 3:23 pm
by AliasBDI
What is wrong with my code?

Code: Select all

<?php $today = now(); echo $today; ?>

Posted: Wed Nov 19, 2003 3:39 pm
by JPlush76
now is only used in database queries(mysql)


check this link out, it should help

http://www.phpnoise.com/tutorials/21/2

Posted: Wed Nov 19, 2003 3:51 pm
by Saethyr
try

Code: Select all

<?php

$str = strtotime('now');
echo date('l dS of F Y h:i:s A',$str);

?>

Code: Select all

&lt;%
now();
%&gt;

is an ASP directive as well if memory serves..

worked fine on my machine BTW

Saethyr

Posted: Wed Nov 19, 2003 4:14 pm
by mchaggis

Code: Select all

<?php $today = date('Y-m-d H:i:s'); echo $today; ?>
will probably will have the desired affect you are after