[development] no date / time types in schema API

Damien damz at prealable.org
Wed Jul 2 10:36:15 UTC 2008


On Wed, Jul 2, 2008 at 12:18 PM, augustin (beginner) <
drupal.beginner at wechange.org> wrote:

>
> Hi,
>
>
> http://en.wikibooks.org/wiki/SQL_dialects_reference/Data_structure_definition/Data_types/Date_and_time_types
> All (but one) SQL dialects have a date type.
> However, Drupal's Schema API does not seem to have a type for date only:
> http://drupal.org/node/159605
>

As I said in #252916 [1], I think DATE / TIME and DATETIME types are really
things of the past. I understand how they could have been useful in the 80s
and 90s, especially on text-based terminals (they are fixed-length!), but
nowadays they are more a nuisance than anything. Database engines have their
own implementation specificities: for example, the Oracle implementation
expects the order of arguments to be locale dependant!

A solution based on timestamps is much more elegant: timestamps need no
(database-specific) parsing whatsoever (both on reading and writing to the
database), they play nice with arithmetic (and thus do not need any helper
functions), and are consistent with the implementation of most application,
including Drupal.

So let's drop the support for them completely in the Schema API. Core don't
use them, please don't encourage contribution modules to.

Damien Tournoud

[1] http://drupal.org/node/252916
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080702/6c67e617/attachment.htm 


More information about the development mailing list