acctman Posted March 9, 2009 Share Posted March 9, 2009 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']; Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/ Share on other sites More sharing options...
Maq Posted March 9, 2009 Share Posted March 9, 2009 I think d_date_format is supposed to be a variable ($)? $d_date_format Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780322 Share on other sites More sharing options...
PFMaBiSmAd Posted March 9, 2009 Share Posted March 9, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780326 Share on other sites More sharing options...
Maq Posted March 9, 2009 Share Posted March 9, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780335 Share on other sites More sharing options...
acctman Posted March 9, 2009 Author Share Posted March 9, 2009 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']); Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780370 Share on other sites More sharing options...
Mark Baker Posted March 9, 2009 Share Posted March 9, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780371 Share on other sites More sharing options...
acctman Posted March 9, 2009 Author Share Posted March 9, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/148595-solved-date-format-output-weird-result/#findComment-780374 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.