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

Andrew Dovganyuk
Andrew Dovganyuk
10,633 Points

Hmm what is wrong???:0)

Hi guys please, tell me what is wrong with this code?!

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

?>
Dan Barrett
Dan Barrett
10,450 Points

Are you getting an error back?

1 Answer

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

Hi there! I know that the output looks correct, but that's because the data is using today's current date which is in the double digits. If today had been December 9th, your output would look like this: December 9, 2016. But they want it to look like this: December 09, 2016. Note the leading 0 in the second date.

Take another look at the documentation to read about what you need to print the date with a leading zero.

Hope this helps, but let me know if you're still stuck! :sparkles: