[geeklog-devel] [Fwd: Re: [propel] Multiple DBMS's and date/time]
Tony Bibbs
tony at tonybibbs.com
Fri Dec 17 11:45:50 EST 2004
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
More information about the geeklog-devel
mailing list