tags:

views:

21

answers:

1

hi friends, i wish to enter the date time values by using drop down list , and after that i want to convert that in date/time field,, please sugest me th ecode ,

thanxs in advance !!!

A: 

You can go like this:

HTML:

 <form method="post">
 ...........

 <select name="datetime">
   <option value="12 Jan 2009">12 Jan 2009</option>
   <!-- more options if you want ->
   ..................
   ..................
 </select>

PHP:

$datetime = $_POST['datetime'];
// convert string to date
$your_date = strtotime($datetime);

Now $your_date contains your date from dropdown you can manipulate any way you want :)

Sarfraz