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

carlos almanzar
carlos almanzar
1,935 Points

help with this

Anyone knows?

index.php
<?php

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



?>

The question asking for the day of the month to have a leading zero. For example, July 04, 2016.

If you want the day portion of the date to have a leading zero in front of it:

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

If you want the day portion of the date to not have a leading zero in front of it:

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

See this page for more information.

1 Answer

Keep the original echo statement where it starts out and on a new line below where they say to start add:

echo date('F d, Y');

Your way is cleaner by far and serves the same purpose. This is one of those examples where you just have to play along.