ShaolinF Posted November 27, 2009 Share Posted November 27, 2009 Hi Guys Anyone know why and how I can fix it ? Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/ Share on other sites More sharing options...
jacko310592 Posted November 27, 2009 Share Posted November 27, 2009 how many days off set is it displaying? it may be because you need to set the default time zone Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/#findComment-966495 Share on other sites More sharing options...
PFMaBiSmAd Posted November 27, 2009 Share Posted November 27, 2009 Please read the documentation for what you are doing - http://us2.php.net/manual/en/function.date.php "now" for a format string would give: Numeric representation of the month, without leading zeros (1-12), ISO-8601 year number, and numeric representation of the day of the week (0-6). So, today (Nov. 27, 2009 where I am located) would give 1120095 Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/#findComment-966497 Share on other sites More sharing options...
ShaolinF Posted November 27, 2009 Author Share Posted November 27, 2009 Thanks for the replies. But the thing it is when I format the date I get the following result: 01/01/70 Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/#findComment-966541 Share on other sites More sharing options...
salathe Posted November 27, 2009 Share Posted November 27, 2009 Show us the code generating that result. Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/#findComment-966566 Share on other sites More sharing options...
the-botman Posted November 27, 2009 Share Posted November 27, 2009 i am also new to php but i hope this helps if u going to use this on php $thedate = date('l dS F Y'); echo '<center><u>' .$thedate. '</center></u>'; that should give you something like Friday 27th November 2009 i hope this helps you in some way hehe Quote Link to comment https://forums.phpfreaks.com/topic/183134-datenow-prints-out-wrong-date/#findComment-966568 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.