Welcome to the Treehouse Community
Looking to learn something new?
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,275 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.