vampke Posted November 16, 2007 Share Posted November 16, 2007 Hi guys, I'm trying to get a very simplr function in this script i'm writing, but for some reason I don't get the right result. I have this code $day = date(Y-M-D); and a bit further in the html code: <?php echo ($day); ?> this returns the value "0". Why won't it give me today's date? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 16, 2007 Share Posted November 16, 2007 its day = date("Y-m-d"); Quote Link to comment Share on other sites More sharing options...
vampke Posted November 16, 2007 Author Share Posted November 16, 2007 thanks that was fast! but it doesn't do what i need: I want to get the format so thoday's date will return 2007-11-16, your solution returns 2007-Nov-Fri I actually need to compare this with another $date, is this possible? or should i go about this differently? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 16, 2007 Share Posted November 16, 2007 sorry forgot some of my php function here you go as you had done befere day = date("Y-M-D"); more information on http://php.net/date Quote Link to comment Share on other sites More sharing options...
vampke Posted November 16, 2007 Author Share Posted November 16, 2007 sorry forgot some of my php function here you go as you had done befere day = date("Y-M-D"); more information on http://php.net/date thanks for your help, with your remark, I found the right solution on google: http://www.highlystructured.com/comparing_dates_php.html Quote Link to comment 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.