Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics PHP on the Web Date Function

It asks me to use "F", and that is exactly what I'm already doing, AND output is correct, but I get a bummer!

I just have to say: Today is (month) (day of the month with leading 0) (comma) (year) and I have the output correctly. Is there something in my program I don't see?

Thanks!

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

2 Answers

andren
andren
28,519 Points

The code checker is often pretty picky about how your code is formatted, it doesn't tend to like when a space is placed between a function name and the parenthesis following it. Since only the third of your date calls have the parenthesis right after the name that is the only one it registers, which is why it complains about you not passing in "F".

Also the date function accepts multiple placeholders being passed to it at once, so you don't need to call it multiple times. If you remove the space before the parenthesis and move all of the placeholders and spaces into just one date call like this:

<?php
echo 'Today is ';
//Place your code below this comment
echo date("F d, Y");
?>

Then your code will pass.

Thank you very much! Andre, it worked! and with that, I finished the course. Thanks for the help! :D