[development] no date / time types in schema API

augustin (beginner) drupal.beginner at wechange.org
Wed Jul 2 11:19:56 UTC 2008


On Wednesday 02 July 2008 19:04:46 Ashraf Amayreh wrote:
> Maybe what you want is strtotime?


Errr, no, it doesn't work. Read again the date I provided.
But thanks. I didn't know this function and it might prove useful one day.

Thanks to Gerhard for his reply. I just upgraded a big module to schema API, 
but I will have to revert about half back and use db_query() instead, as he 
recommends.

I have absolutely no clue how the database layer, the next generation 
(http://drupal.org/node/225450 ) will affect this issue.


Meanwhile,  a database is supposed to store data. It's a bug to limit the kind 
of data that a database can store, and use php to manipulate that data every 
which way. 

To say that nobody needs it is a bit presumptuous. The role of Drupal core is 
to empower module maintainer to use their creativity to code module for every 
possible need. 

You cannot use a timestamp to store dates before or after the UNIX period. 
You cannot use datetime to store a duration, or the time of a recurring 
meeting.
The 'date' or the 'time' data type are perfectly suited for certain special 
applications but this bug forces us to dance around the imposed limitation 
and use php to manipulate the data when the proper data could be directly 
stored instead. 


In short, I do agree it's a bug.


Augustin.


More information about the development mailing list