PHP display date: year, month, day, time, etc.


/ Published in: PHP
Save to your folder(s)

Just a few quick functions to display the date in PHP.


Copy this code and paste it in your HTML
  1. <?php echo date("l"); ?> // Day of the week, ie: Monday
  2. <?php echo date("Y"); ?> // Year, ie: 2012
  3. <?php echo date("F j, Y, g:i a"); ?> // Date and time, ie: March 10, 2001, 5:16 pm

URL: http://www.cannedbanners.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.