Jump to content

[SOLVED] date problem


richiec

Recommended Posts

In my DB i have a date layed out like (July 12th, 2009, 6:43 pm) for each entry for when it was done. Its used for a few pages but on one of the pages i need it to be a shorter version of that date but ive hit a road block because now it just echos back Dec 31st 69 this is what i did:

 

$datedone = mysql_result($result,$i,"date");
$newdate = date("M jS y", $datedone);

 

Any idea where im going wrong?

 

Thanks

 

Rich

Link to comment
https://forums.phpfreaks.com/topic/165830-solved-date-problem/
Share on other sites

Thanks, got it working now =)

 

I did have to add one more thing though before it would work:

 

$datedone = mysql_result($result,$i,"date");
$newd = str_replace(",","",$datedone );
$newdate = date("M jS", strtotime($newd));

 

I guess because i was no longer using , in the new date it was getting confused. But its working now so thanks again for the help <3

Link to comment
https://forums.phpfreaks.com/topic/165830-solved-date-problem/#findComment-874690
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.