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

I think what I have is correct! What could be wrong?

it seems like i'm doing it correctly. my previewed output is the same as it's asking...but it's not accepting it.

help!

Can you post your code?

1 Answer

Mustafa Başaran
Mustafa Başaran
28,046 Points

Hello Daniel,

date() function takes a timestamp argument whose default value is set to current time. Of course, that default value can be changed if one wishes to do so. But that is another day...

After choosing the preferred date format, that is full month name, month day number with 0 digit and full year ('F d, Y'), you can basically print it on the screen with echo command.

Nobody knows format strings by heart. So, please feel free to refer to PHP documentation when seeking the best format: http://php.net/manual/en/function.date.php

So, in php terms >>>

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

I hope this helps.