Migrating would actually be pretty easy -- either remove the behavior from the model, or replace the parse_datetime() function. If it sounds like a good use-case to you guys, is this the type of thing I should share someone, such as on the bakery or from my blog?
John David Anderson (_psychic_) wrote: > On Jun 4, 2007, at 11:45 AM, Joshua Benner wrote: > > >> I'm working with CakePHP with an SQL Server backend to great success. >> One of the hiccups I've encountered, however, is the way that SQL >> Server outputs datetime values by default -- it's not parsable by >> PHP's built-in date functions (such as strtotime()) in its default >> form. >> >> I've written a small behavior with an afterFind function that detects >> and converts SQL Server datetimes to standard datetime strings >> according to the current locale. It's also easily extensible if I need >> consistent conversion of other datatypes in the future. It has been >> working nicely, but I wanted to ask for best practice purposes, and to >> make sure I'm not using unnecessary code... >> >> Is this a valid and effective means to achieve the desired behavior? >> Does anybody have a better method to suggest? >> > > Sounds like a pretty good afterFind() use-case to me... that is, > unless you want to migrate to MySQL or postgres or something. :) > > -- John > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
