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!
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
Ethan Lax782 Points
I'm trying to display the date, formatted as ex:(January 1, 2017) but I keep getting the error "use date('F')".
My input is <?php echo date('F') . ' ' . date('d') . ', ' . date('Y'); ?> I also tried, echo date('F d') . ', ' . date('Y'); and both display the date as required, but the error remains. Please help.
<?php echo 'Today is '; //Place your code below this comment echo date('F') . ' ' . date('d') . ', ' . date('Y'); ?>
Ryan S27,276 Points
You can think of the input parameter of the
date function as the entire output of what you want your date to look like. So all you need to do is replace each part of the string with its corresponding letter, no string concatenation required.
echo date("F d, Y");
Hope this helps.