socalnate Posted October 26, 2007 Share Posted October 26, 2007 <?php $timestamp = time(); echo "<li>Time Submitted:" . date("m/d/Y",timestamp) . "</li>"; ?> Outputs 12/31/1969. Anybody know how to fix it so it outputs the correct time? Nathan Link to comment https://forums.phpfreaks.com/topic/74931-solved-date-function-echos-12311969/ Share on other sites More sharing options...
premiso Posted October 26, 2007 Share Posted October 26, 2007 echo "<li>Time Submitted:" . date("m/d/Y",$timestamp) . "</li>"; Add a $ before timestamp ? Link to comment https://forums.phpfreaks.com/topic/74931-solved-date-function-echos-12311969/#findComment-378894 Share on other sites More sharing options...
kratsg Posted October 26, 2007 Share Posted October 26, 2007 Just shorten the whole thing? <?php echo "<li>Time Submitted:" . date("m/d/Y",time()) . "</li>"; ?> Link to comment https://forums.phpfreaks.com/topic/74931-solved-date-function-echos-12311969/#findComment-378896 Share on other sites More sharing options...
socalnate Posted October 26, 2007 Author Share Posted October 26, 2007 Yes, forgetting the '$' in $timestamp was the problem. lol Link to comment https://forums.phpfreaks.com/topic/74931-solved-date-function-echos-12311969/#findComment-378920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.