Jump to content

Recommended Posts

I'm receiving this 03_03am31e_foTue, 03 Jan 2006 05:37:20 -050001am31 for my date output. I'm trying to get Tue, 03 Jan 2006 05:37:20 only. Does anyone know why i'm receiving all the other weird info in front and back of the date format i'm trying to achieve?

 

//value of $row['com_time'] = 1136284640

$date_c = date(d_date_format,$row['com_time']); 
echo $date_c. '<br>';
echo $row['com_time'];

Link to comment
https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/
Share on other sites

LOL, that's really wild. Php (in it's unhelpful way) treated d_date_format as 'd_date_format' and date() used each of those format characters in producing the output.

 

That's funny, going to take a look at date() functions code...

I think d_date_format is supposed to be a variable ($)?

 

$d_date_format

 

thanks. I saw that as an example used on a site and they didnt have the $ variable, which is odd. even after googling it I found code written that way. anyway I read throught the date() and came up with this.

 

thanks.

 

$date_c = date("D M j G:i:s",$row['com_time']); 

thanks. I saw that as an example used on a site and they didnt have the $ variable, which is odd. even after googling it I found code written that way.

They might have had a constant called d_date_format defined though

 

oh, didnt even think about that. thats something i'll take into consideration next time.

 

thanks

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.