You've got all kinds of options. I suggest you do any date calculations in
the database and use DATE_FORMAT to format any dates pulled out. It's
exactly like the date() function in PHP. MySQL has some great date and time
functions so you can select out exactly what you want. You can use the
UNIXTIME() (I think that's the function) function, too, to convert the MySQL
timestamp to a unix timestamp. It's all in the MySQL manual, chapter 6, Date
and Time Functions.

---John Holmes...

----- Original Message -----
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 12, 2002 5:06 PM
Subject: [PHP] PHP/MySQL -- Date/Time Confusion


> Which method is the best way to store date/time in MySQL and then which
PHP
> command is the best to use to convert that date to something useful? I'm
> having a difficult time figuring out how to reconcile the date in MySQL so
> it works with PHP's various date commands, like getdate().
>
> Any suggestions? I'll mostly need to compared dates/times of different
> records and then extract parts of the date for displaying on the screen.
>
> Thanks!
>
> Monty
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to