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 Quote 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 ? Quote 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>"; ?> Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.