Postgresql timeStamp and ruby Time.now?


#1

Hi,

I have a postgresql DB table which has “timeStamp” field, I wonder if it
is a good way to store time with ruby-rails “Time.now” with a
“timeStamp” field??? or will it better to store the “Time.now” into a
“varchar” or “text”???

does anyone have an idea?

Thanks you very much

Sayoyo


#2

I vote timestamp if you ever want to alter it. but varchar if it is read
only


#3

I use timestamp column type. Also, if you name your columns as
created_on and updated_on you don’t have to populate it, Rails will do
it automatically for you.


#4

I will definitively use timeStamp:)

Thanks you very much for the information!!!

sayoyo

Ahmad wrote:

I use timestamp column type. Also, if you name your columns as
created_on and updated_on you don’t have to populate it, Rails will do
it automatically for you.