When storing date or datetime in the MySQL database it stores it in american format, for example:
2013-04-12 02:12:26
So when it comes for the need to output the above datetime to your website page, you would probably want to display it in a more user-friendly manner.
To view the PHP datetime attrributes visited the official PHP manual: http://php.net/manual/en/function.date.php
Here are some suggestions using PHP code and the corresponding display output ...
<?php echo date('l jS F Y',strtotime($row_YourRecordSet['YourTableName'])); ?>
<?php echo date('l jS M Y',strtotime($row_YourRecordSet['YourTableName'])); ?>
This section is based on formatting the current datetime stamp from the LINUX server your website is hosted on:
<?php echo date('l jS F Y G:sa'); ?>
<?php echo date('l jS M Y G:sa'); ?>
<?php echo date('l jS F Y'); ?>
<?php echo date('l jS M Y'); ?>
Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.
Sign in to add commentsYour friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.
serhat_alpaslan: 10 Years, 3 Months, 1 Day, 15 Hours, 35 Minutes ago
thanks