[Rails] Re: Is it a good idea to use timestamps
On Monday, 21 October 2013 13:24:47 UTC-4, desbest wrote:
Timestamps are a number that counts the number of seconds from the epoch date 1/1/1970.I read somewhere on the internet, that timestamps will expire in the year 2038.This is why I always use yyyy-mm-dd and yyyy-mm-dd HH:ss to show the date and I don't use timestamps or time database columns.Is it a good idea to use timestamps, or should I continue with yyyy-mm-dd HH:ss ?
Depends on your database - in MySQL the TIMESTAMP column type is limited to 2038, but in others (Postgres, for one) this isn't the case.
If you declare your columns as :datetime in Rails migrations you'll get a type (regardless of database adapter) that doesn't have this problem.
--Matt Jones
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/933b19e1-5650-4640-8993-38df2a9f9590%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home