[development] no date / time types in schema API
drupal.beginner at wechange.org
Wed Jul 2 10:18:55 UTC 2008
All (but one) SQL dialects have a date type.
However, Drupal's Schema API does not seem to have a type for date only:
It causes schema.module to complain: no type for Schema type date:normal.
I am concerned that with the new Schema API, my modules may not install
properly anymore. (how can it install a table where a column has an
Is this a purposeful omission?
I just found this issue:
so others noticed, too :)
How are you all coping with the lack of time/date data type?
What workarounds do you use?
I could use the data type datetime, but then I have to worry about truncating
the time part which I do not need. I use substr() to truncate the part I
don't want, but coder.module complains about it (says I should use
drupal_substr() while substr() is quicker and safe in this case).
There is probably a better way to truncate the time part (please say), but it
feels a shame to have to deal with the extraneous time part when Schema API
could easily handle date types.
More information about the development