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? Link to comment https://forums.phpfreaks.com/topic/77597-solved-date-problem/ Share on other sites More sharing options...
rajivgonsalves Posted November 16, 2007 Share Posted November 16, 2007 its day = date("Y-m-d"); Link to comment https://forums.phpfreaks.com/topic/77597-solved-date-problem/#findComment-392767 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? Link to comment https://forums.phpfreaks.com/topic/77597-solved-date-problem/#findComment-392768 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 Link to comment https://forums.phpfreaks.com/topic/77597-solved-date-problem/#findComment-392772 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 Link to comment https://forums.phpfreaks.com/topic/77597-solved-date-problem/#findComment-392773 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.