1

When I looked into users.created field in the database, it says, that is has type int. Does anybody know, why Drupal team chose this format instead of datetime? Cause timestamp will end with the end of UNIX epoch:

http://en.wikipedia.org/wiki/Year_2038_problem

As they are setting it to this value:

$account->created = REQUEST_TIME;

http://api.drupal.org/api/drupal/includes!bootstrap.inc/constant/REQUEST_TIME/7

And datetime is unlimited. So, why was this inferior variant chosen?

2

Date/time types vary widely among different DB types. The purpose of the Schema API is to achieve some compatibility at the data definition level.

If you see this http://drupal.org/node/159605 the date/time is not supported in some database type.

So I would prefer to go the way the date module does it and use int if you want to make it compatible across multiple database types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.