Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.