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

John Lukacs
John Lukacs
26,806 Points

For this code challenge, you'll need to check out the documentation for the date function to see details about formattin

Why does my code not pass it looks correct

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

?>

5 Answers

Casey Ydenberg
Casey Ydenberg
15,622 Points

Try

echo date('F d, Y');

That should produce the same result, though.

John Lukacs
John Lukacs
26,806 Points

You glorious tit willer

Casey Ydenberg
Casey Ydenberg
15,622 Points

Thats an odd remark. Did the solution help you?

Brandon Leung
Brandon Leung
17,734 Points

Thanks for this! I was using the escape character before the comma. Problem solved!

sean shea
sean shea
22,104 Points

Thank you :P I was tying echo date('D d, Y'); and I couldnt figure out what was wrong lol

Filip Sevcik
Filip Sevcik
2,279 Points
echo "Today is ";
echo date("F d, Y");

You can get the same exact result by concatenating, either by variable assignment as I've done below or by just calling the date function itself. However for whatever reason, treehouse won't take this as a correct answer.

$today = date("F d, Y");
echo 'Today is ' . $today . "." ;

or

echo 'Today is ' . date("F d, Y") . ".";