Hi,
I am using rails 2.3.2. and database postgressql.
I have created one table with name “courses”.
In that table I have the field “name, user_id, created_at and
updated_at”.
For insertion I am writing code like this:-
Course.create(:name=>params[:name], :user_id=>params[:id])
It is saving the record into database but I have seen that created_at
and updated_at values are ahead of one day.
Can anyone help me out for this?
Thanks,
Tushar
Tushar G. wrote:
Hi,
I am using rails 2.3.2. and database postgressql.
I have created one table with name “courses”.
In that table I have the field “name, user_id, created_at and
updated_at”.
For insertion I am writing code like this:-
Course.create(:name=>params[:name], :user_id=>params[:id])
It is saving the record into database but I have seen that created_at
and updated_at values are ahead of one day.
Can anyone help me out for this?
Thanks,
Tushar
Rails fills in these fields automatically, using Time.now, which in turn
just uses your system time. Are you sure your system clock is set to
the right date?
I may have misunderstood your question, it wasn’t very clear, if so then
sorry.