now()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

now()

Post by AliasBDI »

What is wrong with my code?

Code: Select all

<?php $today = now(); echo $today; ?>
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

now is only used in database queries(mysql)


check this link out, it should help

http://www.phpnoise.com/tutorials/21/2
User avatar
Saethyr
Forum Contributor
Posts: 182
Joined: Thu Sep 25, 2003 9:21 am
Location: Wichita, Kansas USA
Contact:

Post 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
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Post 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
Post Reply