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

Carol Davis
Carol Davis
2,581 Points

Use the date function to display the full month, day of the month with leading zero and the full year

I get an error message that I must use the Date function:

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

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

4 Answers

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

Hi there, Carol! You're doing great, but you have a couple of typos. Now while PHP isn't generally picky about whitespace it can be in the case of functions/methods. This is the case with the date(). You may not have a space between date and the open parenthesis. Also, your comma is misplaced. The comma is supposed to come after the date with a space after and the year. Currently your comma is after the month and before the date. Make these changes and it should pass!

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

Algirdas Lalys
Algirdas Lalys
9,389 Points

Hi Carol Davis, You don't need space between function name and parenthesis. And comma should be after d not before it according to challenge.

<?php
echo date("F d, Y");
?>

Hi Carol,

You have a space between date function name and the parenthesis.

Carol Davis
Carol Davis
2,581 Points

thank you - I should have noticed that