scottybwoy Posted May 10, 2007 Share Posted May 10, 2007 Hi Crew, I'm trying to present a MSSQL timestamp in php. If I select the record and put it in a $var and try to echo it like so : echo date(DMdY, $date); echo date(Gi, $date); It always returns Thu01011970 So how would I get this to display correctly? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/ Share on other sites More sharing options...
only one Posted May 10, 2007 Share Posted May 10, 2007 echo "" . date("DMdY", $date) . ""; echo "" . date("Gi", $date) . ""; try that Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/#findComment-249731 Share on other sites More sharing options...
jitesh Posted May 10, 2007 Share Posted May 10, 2007 echo date("DMdY", strtotime($date)); Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/#findComment-249736 Share on other sites More sharing options...
scottybwoy Posted May 10, 2007 Author Share Posted May 10, 2007 No this doesn't work, how does MS_SQL Store timestamp? All it shows is binary data using MS_SQL management studio? Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/#findComment-249761 Share on other sites More sharing options...
cluce Posted May 10, 2007 Share Posted May 10, 2007 this link may help you http://www.w3schools.com/php/php_date.asp Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/#findComment-249901 Share on other sites More sharing options...
scottybwoy Posted May 10, 2007 Author Share Posted May 10, 2007 Yeah, thanks for all your help. But I figured I was looking in the wrong place. For some reason all my timestamps are creating the same date. I'll need to see why that is. My problem was not that it's displaying the date wrong, just the wrong date Quote Link to comment https://forums.phpfreaks.com/topic/50779-dealing-with-dates/#findComment-249918 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.