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

Randy Mckissack
Randy Mckissack
6,471 Points

This code displays correctly. What am I not doing correctly here?

Questions wants display Today is followed by today's date. <?php echo 'Today is '; //Place your code below this comment echo Date("F d, Y"); ?>

This will display the date correctly but it is counted wrong. I don't know why.

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

2 Answers

Your code is almost correct, the only thing wrong with it that is causing the error is the fact that you started the function date with a capital letter. Change it to echo date("F d, Y"); and it should work fine.

Randy Mckissack
Randy Mckissack
6,471 Points

Thank you! It's the little things like that that seem to trip me up..

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

Hi there! To be perfectly honest, I'm not sure why it shows the correct date. That being said, it's expecting you to use the built-in date function. Essentially, you have a capitalization error. Instead of Date it should be date.

Hope this helps! :sparkles:

Randy Mckissack
Randy Mckissack
6,471 Points

Thank you! I couldn't see it for looking at it.