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

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.