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 trialEran Mor
1,503 PointsChallenge Task 1 of 1 - date() function
This is the task:
Use the date function to add todays date to the display message in the following format: full month, day of the month with leading 0, comma and 4 digit year. Example: Today is July 04, 2016
Preview is indicating my solution works but the auto checker is not passing it to the next level. I have tried multiple ways to write it and all were correct according to "Preview" .
The error I get is "You have not passed the correct string for formatting".
Thank you
<?php
echo 'Today is ';
echo date('F d\, Y');
?>
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You're doing just fine. And while the preview does show the same thing, they are specifically grading what is inside the parentheses to the date()
function. You've included an escape character \
that isn't needed. Removing this will cause the challenge to pass.
Good luck!
Eran Mor
1,503 PointsEran Mor
1,503 PointsThank you Jennifer.