After scouring threw posts and not getting the answer needed ive decided to ask. If it has been answered sorry for asking but I havnt found it.
I have a form that is used to add new projects to a database. Currently the time is added by hand. What I would like to be able to do is have the time added by php instead of by me. But dont want it to be added as a timestamp. I want it to be preformated. Instead of having the timestamp in the database it will already be formatted how i want it. Example: 2003-04-07 19:52:09
The field name is: Date and the type is: datetime
Is this possible?
date_format function takes a date and converts it to the format given
%D = Day of the month %M = Month %Y = Year
date_format(date2,'%D %M %Y') --> returns somthing like 30-08-2003
u'll find more information about this on mysql.com website.
How can I put this into a form? This is what I have for a current form. What I dont understand since I wont have interaction with the date/time anymore is how to implement this into the form. Any ideas?
<form method="post" action="<?php echo $PHP_SELF?>"> cid: <input type="Text"name="cid"><br> title: <input type="Text"name="title"><br> subtitle: <input type="Text"name="subtitle"><br> active: <input type="Text"name="active"><br> page_header: <input type="Text"name="page_header"><br> text: <input type="Text"name="text"><br> page_footer: <input type="Text"name="page_footer"><br> signature: <input type="Text"name="signature"><br> date: <input type="Text"name="date"><BR> name: <input type="Text"name="name"><BR> real_name: <input type="Text"name="real_name"><BR> thumbnail: <input type="Text"name="thumbnail"><BR> <input type="Submit" name="submit" value="Enter information"></form>
You could put the value in the <input> tag.
<input type='text' name='date' value='<? echo date( 'Y-m-d H:i:s' ); ?>' >
Halfabee
Originally posted by HalfaBee You could put the value in the <input> tag. <input type='text' name='date' value='<? echo date( 'Y-m-d H:i:s' ); ?>' > Halfabee
that is what i call perfection. displays perfectly.