Project / Support Center
Welcome, Guest. Please login or register. October 23, 2020, 12:43: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL/PHP  |  Topic: Echoing a mysql DATE field in readable formats 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: Echoing a mysql DATE field in readable formats  (Read 6817 times)
admin
Administrator
******
Offline Offline

Posts: 205


« on: January 15, 2014, 04:42: PM »

This works best

 <?php
  // make date normal day month dd, yyyy
  $mysqldate = $row_rsclass['reunion_date'];
  $mydate = date("l F j, Y",strtotime($mysqldate));
  echo $mydate;
?>


To echo a Mysql DATE field in a way that can be read use these formats:

Saturday, October 11, 2014

<?php echo date("l, F d, Y",strtotime($row_rsclass['date']));?>

January 15, 2014   

<?php echo date("F d, Y",strtotime($row_rsclass['date']));?>

Wednesday, January 15, 2014   

<?php echo date("l, F d, Y",strtotime($row_rsclass['date']));?>

Jan 15, 2014   

<?php echo date("M d, Y",strtotime($row_rsclass['date']));?>

15 January 2014   

<?php echo date("d F Y",strtotime($row_rsclass['date']));?>

15 Jan 2014   

<?php echo date("d M Y",strtotime($row_rsclass['date']));?>

Wed, 15 Jan 2014

<?php echo date("D, d M Y",strtotime($row_rsclass['date']));?>

Wednesday, the 15th of January, 2014   

<?php echo date("l",strtotime($row_rsclass['date'])) . ", the " . date("jS",strtotime($row_rsclass['date'])) . " of " . date("F, Y",strtotime($row_rsclass['date']));?>


For a listing of all date time php codes look here:

http://webglobalnet.net/support/index.php?topic=1060.0
« Last Edit: December 26, 2016, 03:45: AM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL/PHP  |  Topic: Echoing a mysql DATE field in readable formats « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!