Jump to content


Photo

Centering "date" statement


  • Please log in to reply
2 replies to this topic

#1 jeffpoulsen

jeffpoulsen
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 22 October 2006 - 01:22 PM

Just starting to learn PHP on my own.
I have a simple question. I have a simple line in and cannot get it to "echo" in the center of the page. The line is:

echo date('M j g:i:a');

I don't want to put the code in a table but for this simple task I would rather not. I can get this to work for the preceding line:

echo "<center>The Date and Time is</center>";

But not for the line above. I can find no answers at this stage. Can anyone help?

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 October 2006 - 01:26 PM

echo "<center>The Date and Time is<br/>". date('M j g:i:a'). "</center>";

Legend has it that reading the manual never killed anyone.
My site

#3 jeffpoulsen

jeffpoulsen
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 22 October 2006 - 01:48 PM

Thanks, I quess the (.) helps.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users