[geeklog-devel] [Fwd: Re: [propel] Multiple DBMS's and date/time]

Blaine Lang geeklog at langfamily.ca
Wed Dec 22 11:33:10 EST 2004


Will we still not need Library functions then to compare dates in code as I 
think you need to convert the YY-MM-DD HH:MM:SS Date/time format strings to 
UNIX Timestamps for comparison in code - correct?

Or did I read that you can request Propel to do this converstion when 
retrieving the field?

Blaine

----- Original Message ----- 
From: "Vincent Furia" <vfuria at gmail.com>
To: <geeklog-devel at lists.geeklog.net>
Sent: Friday, December 17, 2004 12:16 PM
Subject: Re: [geeklog-devel] [Fwd: Re: [propel] Multiple DBMS's and 
date/time]


TIMESTAMP in Propel == DATETIME in MySQL. So in mysql DDL you'd want
to use DATETIME.

-Vinny


On Fri, 17 Dec 2004 10:45:50 -0600, Tony Bibbs <tony at tonybibbs.com> wrote:
> Seems like we should go with the timestamp data type.  Read below.
>
> --Tony
>
> -------- Original Message --------
> Subject:        Re: [propel] Multiple DBMS's and date/time
> Date:   Fri, 17 Dec 2004 11:36:17 -0500 (EST)
> From:   Hans Lellelid <hans at velum.net>
> Reply-To:       users at propel.tigris.org
> To:     users at propel.tigris.org
> References:     <41C304F4.7020205 at tonybibbs.com>
> <15195.69.17.56.162.1103300475.spork at webmail.hozn.net>
> <41C308F8.2090905 at tonybibbs.com>
>
> Yeah, I'm quite sure you can set it at runtime, though you may need to set
> it before opening the connection.  I used to set it in Creole
> MSSQLConnection class, but there was some reason that this wasn't always a
> good idea.  ... perhaps it was breaking when using freetds instead of MS
> libs or something.
>
> -Hans
>
> > Cool.  Is the MSSQL option you refer to in php.ini something I can set
> > at runtime via ini_set()?
> >
> > --Tony
> >
> > Hans Lellelid wrote:
> >
> >>>I have a project that will be supported under multiple DBMS's (MySQL,
> >>>Postgres and MS SQL).  We are doing the general database design and we
> >>>are to the topic of how to formate date/time values.  All our values
> >>>will be after 1970 so timestamps are an options.  My question is 
> >>>whether
> >>>or not to use the native date/time types in the DBMS via Propel.  Does
> >>>Propel handle this well or am I better of using a timestamp datatype or
> >>>int?
> >>>
> >>>
> >>>
> >>
> >>Propel handles this well and I would advise you to use TIMESTAMP rather
> >>than INT.
> >>
> >>TIMESTAMP will be converted to the best representation (e.g. for MySQL 
> >>it
> >>will use DATETIME) for the RDBMS.  The only thing you'll probably want 
> >>to
> >>fix is the MSSQL ini option (in php.ini) to have it use standard ISO 
> >>date
> >>formats.
> >>
> >>The getter methods that are generated by Propel will actually allow you
> >> to
> >>specify date/time formatters:
> >>
> >>$myobj->getTimeCol("Y-m-d"); // date()-formatting
> >>
> >>or
> >>
> >>$myobj->getTimeCol("%c"); // strftime()-formatting
> >>
> >>or
> >>
> >>$myobj->getTimeCol(null); // native unix timestamp
> >>
> >>or
> >>
> >>$myobj->getTimeCol(); // default is ISO: Y-m-d H:i:s
> >>
> >>Hope that helps.
> >>
> >>-Hans
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe at propel.tigris.org
> >>For additional commands, e-mail: users-help at propel.tigris.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe at propel.tigris.org
> > For additional commands, e-mail: users-help at propel.tigris.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at propel.tigris.org
> For additional commands, e-mail: users-help at propel.tigris.org
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-devel 




More information about the geeklog-devel mailing list