Re: Using dates, timestamps...
| From: | Justin Patrin | Date: | Sat, 09 Oct 2004 06:21:14 +0000 |
| Subject: | Re: Using dates, timestamps... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14826@lists.php.net to get a copy of this message | ||
On Sat, 9 Oct 2004 00:50:52 +0200, Mos <mos_fr@yahoo.fr> wrote:
> Hi everybody !
>
> Is there a class in PEAR projects available to work with dates/times with
> different database systems (MySQL, PostgreSQL...) ?
>
> I mean PEAR:DB allow to work with several database. How to save date and
> time data in theses DBMS ? TimeStamps or other system ?
>
Sure... there's MDB if you want absolutely full DB independent dates,
but it uses strings to do it. Or you can use the dates in the DB and,
if it's a formatted date (not a mysql timestamp), you can just use
strtotime() to make it a Unix timestamp. Or you can use the PEAR::Date
package to do DB independant date manipulations (like with strtotime,
but doesn't have the limitations of a unix timestamp). Or you use
DB_DataObject. DB_DataObject_FormBuilder has some built-in date
callback functions which allow you to convert dates.
Lots of options. ;-)
--
paperCrane --Justin Patrin--