Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PEAR] DB_DataObject: auto-convert YYYYMMDD integers to proper mySQL DATE types
On Fri, 25 Mar 2005 16:43:18 +0100, Massimiliano Bariola
<m.bariola@prodigiweb.it> wrote:
> Justin Patrin wrote:
> 
> Sorry for taking so long to answer. No, I really wanted to take
> advantage of mySQL's ability to convert a YYYYMMDD( HH:II:SS) -
> formatted number or string to the human-readble DATE/DATETIME form. Only
> that DBDO seems to correctly do it if the initial field is a string
> (sorry for the example above which does not show the real string -- it
> should have been '20050323' and not '2005-03-23').
> The fact is that my original database dump contains datetimes as
> YYYYMMDDHHIISS integers, so I didn't want to format the original records
> to the YYYY-MM-DD HH:II:SS form on-the-fly. I am a lazy guy and besides,
> MySQL is more than capable of converting it by itself, even when
> starting from integers and not strings ;)
>
> So, DBDO works on a YYYYMMDDHHIISS string but not on a
> similarly-formatted integer - while mySQL does.
> I felt it's something that maybe should be addressed in future releases
> of DBDO.
>

Likely it assumes it's a unix timestamp if it's an integer. Seriously,
that format makes no sense as an integer as it's really a formatted
string. If you start doing integer stuff to it (addition, etc) you're
going to end up with something unusable.

--
Justin Patrin

Report this thread to moderator Post Follow-up to this message
Old Post
Justin Patrin
03-25-05 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:53 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.