Re: php & date manupulation functions
| From: | leo g. divinagracia iii | Date: | Wed, 19 Feb 2003 09:56:22 +0000 |
| Subject: | Re: php & date manupulation functions | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25756@lists.php.net to get a copy of this message | ||
Rajesh Fowkar wrote:
Hello, There seems to be very few date manupulation functions in php. In my php form I am displaying select combos for day, month and year. Now while updating the form I want to retrieve the date and take out day, month and year from that date and display the correct selection in the combo. I could not find any function like say day($dbdate); month($dbdate); year($dbdate); Am I missing something ? Is there anyway to accomplish the above ? or I will have to store these three values separatly in the database rather than as a date.yes, you are missing it. you need to do the opposite. first read this: http://www.php.net/manual/en/function.date.php and everything will become clear... btw, if the current date is jan 1, 2000, then $day = date ("d"); $month = date ("m"); $year = "date ("y"); echo $day; // would return "01" echo $month; // would return "01" echo 4year; //would return "00" -- Leo G. Divinagracia III ldivinag@csuhayward.edu