If you'd bothered to RTFM, you'd know both answers already. strtotime() for number one, and date() accepts an optional second argument (the timestamp).

Ian Gray wrote:

I am wanting one field on a table in one of my MYSQL databases to contain different dates and times as a epoch timestamps.

Firstly how do I convert a particular time and date which the user will enter on the website into the epoch timestamp.

And secondly, how do I convert it back once taken of the table. I'd like to use the date function to print out this particular date and time- for example $a = date('g:IA l, jS F, Y') so that $a could say '7:30PM Saturday, 23rd August, 2003' Does date only work by outputting the current date or time? Can you get it to output the format of any date and time you would like?

I'd be grateful for any help!

Ian Gray



-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



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



Reply via email to