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

Error is need correct string formatting. What is treehouse looking for? My format prints correctly.

My answer is this.

echo date('F m, Y');

but Im still getting a string formatting error.

index.php
<?php
echo 'Today is ';
//Place your code below this comment
echo date('F m, Y');

?>

2 Answers

Hi, James!

For this, I would have used a "d" inside your format string instead of an "m".

<?php
    date("F d, Y");

I tried to test this and did see the right answer comeback in the view but when I tried to submit the answer, it kept saying I was incorrect. At this point, I would notify treehouse that something is wrong with that particular exam and move forward.

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

I have updated the challenge to give more hints. James Koene the only thing you need to do is return the day ('d') instead of the month ('m') in your string :)