PDA

View Full Version : default date value



amykhar
Fri 5th Oct '01, 10:20am
Within a template, I have a form. One of the fields is a date field, and I would like to make the field default to the day's date in the format yyyy-mm-dd

I am not even sure where to begin. Can somebody get me started please?

Thank you,
Amy

Chen
Fri 5th Oct '01, 10:23am
To get todays date or "right now's" time, use the date function, but without a timestamp:
http://www.php.net/manual/en/function.date.php

For what you need, use this:

$todaysdate=date("Y-m-d");
and voila. :)

amykhar
Fri 5th Oct '01, 12:08pm
Thank you. I got it working :)

Amy