Jump to content

Datetime


jkkenzie

Recommended Posts

It would be easier, and more efficient, to format the date in the query string using MySQL's DATE_FORMAT() function.

 

SELECT DATE_FORMAT(`created`, '%m %d %Y') AS created_alias

 

Then the formatted date could be accessed directly through $val['created_alias'].

 

Also, you'd be better off to get out of the habit of using the <?= 'quick-echo' syntax and use the full <?php echo instead. Doing so will save you headaches in the future.

Link to comment
https://forums.phpfreaks.com/topic/220354-datetime/#findComment-1141837
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.