Re: php & date manupulation functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux