cturner Posted October 24, 2006 Share Posted October 24, 2006 Can someone please tell me how I can convert a mktime date (mktime(0,0,0,$month -1,$d,$year)) to something like 21 October 2006? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
heckenschutze Posted October 24, 2006 Share Posted October 24, 2006 Use [url=http://php.net/date]date()[/url]eg:[code]<?phpecho date("d F Y", mktime(0, 0, 0, $month -1, $d, $year));?>[/code] Quote Link to comment Share on other sites More sharing options...
cturner Posted October 24, 2006 Author Share Posted October 24, 2006 Thanks for your reply heckenschutze but it is displaying 0 as the 1st day of a month. I am clicking on a date in a calendar to come to the code that is below.[code]require "config.php";// get the entry date$entry_date = $_GET['entry_date'];// select the diary entry for the entry_date$query = "SELECT * FROM `diary_contents` WHERE `date` = '$entry_date'";// display the diary entries for the entry dateecho date("w F Y", $entry_date);// more code to come[/code] Quote Link to comment Share on other sites More sharing options...
heckenschutze Posted October 24, 2006 Share Posted October 24, 2006 use 'j' instead of 'd'...[code]echo date("j F Y", $entry_date);[/code] Quote Link to comment Share on other sites More sharing options...
cturner Posted October 24, 2006 Author Share Posted October 24, 2006 Problem is now solved thanks to heckenschutze. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.