Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJohn Wunder
1,660 PointsMessage Bummer! You must use the built-in date function invalidly displayed
Tried typing this in 6 ways from Sunday all with the date function but cannot get past this screen. https://teamtreehouse.com/library/php-basics-2/php-on-the-web/date-function
<?php
echo 'Today is ';
//Place your code below this comment
echo date ('M d, Y');
?>
3 Answers
Unsubscribed User
19,024 PointsHi,
Bit odd but it works for me without the space after date
<?php
echo 'Today is ';
//Place your code below this comment
echo date('F d, Y');
?>
John Wunder
1,660 PointsThank you....that was a combination I had not tried...I for whatever reason automatically put the space in. Taking it out fixed. Have a good night.
Oliwer Bendelin
6,390 PointsThis task is quite tricky, but since it wants your to display the whole month and not just the 3 first letter, you need to use 'F' as the format character, like this:
<?php
echo 'Today is ';
//Place your code below this comment
echo date ('F d, Y')
?>
You can check this site for more format characters: http://php.net/manual/en/function.date.php
John Wunder
1,660 PointsYeah I had tried that should have pasted that one in. Tried a bunch of ways of formatting it including updating the first line, concatenating the second line, using echo to write just the date, the date and Today is and a few others. I always get the not using built-in date. Here's the current failing program. <?php echo 'Today is ' ; //Place your code below this comment echo date ('F d, Y'); ?> As a suggestion give a frustration button that gives me the answer so I can off this damn page, know what I screwed up and move on.
I'm just going to skip it. My preview looks fine and I think the check work routine is broke.
Alexander Nygaard
988 PointsI agree with solution, but mine did not pass until I removed the space between date and ( E.g.
<?php
echo 'Today is ';
//Place your code below this comment
echo date('F d, Y')
?>
Meanwhile this was considered incorrect:
<?php
echo 'Today is ';
//Place your code below this comment
echo date ('F d, Y')
?>
It also baffles me that the original guide uses " instead of ', as I read in the other topics about this issue, that ' is the only correct use.
Scott McGrath
Courses Plus Student 2,164 PointsI was getting this wrong and it was only because I was using a capital D for the date function. (facepalmslap)
John Wunder
1,660 PointsJohn Wunder
1,660 PointsYeah I had tried that first should have pasted that one in. Tried a bunch of ways of formatting it including updating the first line, concatenating the second line, using echo to write just the date, the date and Today is and a few others. I always get the not using built-in date. Here's the current failing program. <?php echo 'Today is ' ; //Place your code below this comment echo date ('F d, Y'); ?> As a suggestion give a frustration button that gives me the answer so I can off this damn page, know what I screwed up and move on.