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 trial

PHP PHP Basics PHP on the Web Date Function

Eran Mor
Eran Mor
1,503 Points

Challenge 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

index.php
<?php
echo 'Today is ';
echo date('F d\, Y');
?>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles:

Eran Mor
Eran Mor
1,503 Points

Thank you Jennifer.