RE: mysql/php date functions..

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

 



so you play with the time/date vars on the php side, and then simply store
them in the mysql tbl as a int(10)... or do you actually store the vars in
the mysql timestamp...

and then use the mysql date/time functions...

ie. how would you do the following...

 get a date (date1)
 get a date (date2)
 store the date1/time in mysql
 add the date1 + date2 and store the result in mysql
 read the result from mysql, with the result being in the year/month/date
format

------

or,

would you just get the unix_timestamp representation of the dates, and store
the 10 int formats in the mysql tbl. you could then extract/select the date
information from the tbls, and do all the date calculations in php...

the downside to this is that you'd have to convert all the date information
from mysql to a human readable format...

thoughts/comments/etc...

-bruce


-----Original Message-----
From: John Nichel [mailto:john@xxxxxxxxxxxx]
Sent: Monday, September 26, 2005 11:48 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  mysql/php date functions..


bruce wrote:
> john...
>
> that appears to be it!! although i would have assumes it would have done a
> most significant bit fill with 0's...
>
> so my question also comes down to .. do i use the php date functions for
> date/time manipulation.. or do i use the mysql functions....
>
> any thoughts/suggestions...
>
> -bruce

Personal preference I guess.  Me, I use UNIX timestamps.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux