reazik Posted March 24, 2006 Share Posted March 24, 2006 Hi all. I'm new (no kidding; I'm posting in the newbie section!) :)I'm adapting a job bulletin script for my company, and I'm trying to create a column that shows when the job listing was last updated. There was already a job_date column built into the MySQL code, so I used that in my page; however, it comes through as a string of numbers, and I have no idea how to fix it.Here's the code blurb:<table width="90%"><tr valign="top" {ALTERNANCE}><td width="30" class="style1"><a href="details.php?id={JOB_ID}" class="style2">{JOB_NAME_TITLE}</a></td><td width="60" align="center" class="style1">{JOB_STATE}</td><td width="300" class="style1">{JOB_SUMMARY}</td>[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<td width="110" colspan="2" class="style1">{JOB_DATE}[!--colorc--][/span][!--/colorc--]</td></tr></table>and [a href=\"http://www.psninc.net/forms/JobBulletin/list.php\" target=\"_blank\"]Here's[/a] the result. Is there anything I can do to convert it? Is this even a PHP function? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 24, 2006 Share Posted March 24, 2006 You can format the the date in the query using MySQL's DATE_FORMAT() function or you can do it in PHP using the date() function. eg[code]$formatted_date = date('j M Y', $dbdate);[/code] Quote Link to comment Share on other sites More sharing options...
reazik Posted March 24, 2006 Author Share Posted March 24, 2006 [!--quoteo(post=358055:date=Mar 24 2006, 04:10 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 24 2006, 04:10 PM) [snapback]358055[/snapback][/div][div class=\'quotemain\'][!--quotec--]You can format the the date in the query using MySQL's DATE_FORMAT() function or you can do it in PHP using the date() function. eg[code]$formatted_date = date('j M Y', $dbdate);[/code][/quote]Where do I need to put this code? I've tried various ways, but I keep getting text instead of reformatting the date. I really appreciate your help.I had already tried to do it through MySQL, but it just blanked out the dates and gave me 0000-00-00. 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.