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:


As they are setting it to this value:

$account->created = REQUEST_TIME;


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


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.

| improve this answer | |

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.