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

Marcus Schumacher
Marcus Schumacher
16,616 Points

Why doesn't this work?

Here's the prompt

For this code challenge, you'll need to check out the documentation for the date function to see details about formatting. Use the date function to add today's 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

Here's what it's telling me

Bummer! To return the full textual representation of a month, use "F"

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

1 Answer

Hi Marcus,

You only need to make 1 call to the date() function and pass in as the first argument the format string for the entire date.

You're allowed to put all the pieces together like this 'F d, Y'

Also, you don't have to echo a space at the beginning. There is already a space at the end of the first echo statement.