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 trialCarol Davis
2,581 PointsUse the date function to display the full month, day of the month with leading zero and the full year
I get an error message that I must use the Date function:
<?php echo 'Today is '; //Place your code below this comment echo date ("F, d Y"); ?>
<?php
echo 'Today is ';
//Place your code below this comment
echo date ("F, d Y");
?>
4 Answers
Jennifer Nordell
Treehouse TeacherHi there, Carol! You're doing great, but you have a couple of typos. Now while PHP isn't generally picky about whitespace it can be in the case of functions/methods. This is the case with the date()
. You may not have a space between date
and the open parenthesis. Also, your comma is misplaced. The comma is supposed to come after the date with a space after and the year. Currently your comma is after the month and before the date. Make these changes and it should pass!
I hope this helps, but let me know if you're still stuck!
Algirdas Lalys
9,389 PointsHi Carol Davis, You don't need space between function name and parenthesis. And comma should be after d not before it according to challenge.
<?php
echo date("F d, Y");
?>
Brandon Kueker
2,161 PointsHi Carol,
You have a space between date function name and the parenthesis.
Carol Davis
2,581 Pointsthank you - I should have noticed that