On 12/4/06, John Siracusa <[EMAIL PROTECTED]> wrote: > Well what does Oracle do? Is a YY value of 50 the year 1950 or 2050 > or something else? And so on for 00-99. And what about the 1800s and > 2100s? Basically, to parse YY, we have to know exactly what Oracle > does so we can follow the same rules.
Well, see Ken's example earlier. YY of value 50 can be any of 1850, 1950 or 2050. Since oracle outputs that format but doesn't input that format (hmm, I'll double check how Oracle deals with the DD-MON-YY date format as input when I'm at the office tomorrow). > Yeah, I'm never going to support all possible nls_*_format strings, > just the most reasonable ones. If someone wants to support something > fancier, they'd have to either make a custom column class or a custom > Rose::DB-derived class with a driver class for Oracle that implements > parse_date() and format_date() according to their wishes. That is fair enough. > Yeah, aren't there other nls_*_format settings for timestamp and > datetime and so on? date is a datetime and timestamp is a datetime with and higher precision timezone info (dumb!) and does not appear until 9i. What I'm seeing as I google around is that nls_date_format when set applies to TIMESTAMPs as well as DATEs > There's already an Epoch column class in RDBO than translates seconds > since the Unix epoch into DateTime objects. For strings, if they're > in a format that the current Rose::DB::* database driver's parse_XXX() > and format_XXX() methods can understand, just "lie" in your RDBO class > and say the column is of type XXX, even, though it's really a varchar > or whatever. (That's how Arrays are emulated in MySQL, for example.) That's fantastic. Thanks John. - Clayton ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object