Jump to content

[SOLVED] date format output weird result.


acctman

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

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

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.