use int or timestamp for save timestamp


Why in Yii init migration, use int for saving timestamp( updated_at and created_at)? why didnt use mysql timestamp data type? what is pros and cons of it?

BTW this page scared me :

any help

Well, it’s just simpler to manipulate ints.


Why are you scared by year 2038 "bug"? …

Do you think ANY web-application you code today,

will still be running in 22 years? :)

Best Regards

MetaCrawler, why not? My blog is 11 years old and is still running fine :)

And you never made any changes to the code of your blog in 11 years? ;)

What I actually wanted to say is:

22 years are a lot of time and over the time things change…

So even when he is afraid of the year 2038 problem today…

It’s most likely that there will be some kind of “common solution” to this problem before year 2038. :)


Before 2038 I think we’ll be all using x64.

and how it will affect on int, i mean how many numbers can it save with out crash?

It’s already mentioned in Wiki.