Your problem is that strftime only formats the time; it does not actually change the time.
So, when you do Time.now, it returns the time. Strftime only changes the way it is presented.
If you want to change the created_at date to "2012-02-27 00:00:00" just go to @koncurrencer.created_at
@koncurrencer.created_at = "2012-02-27 00:00:00"
That should do it.
In answer to your question:
What you did should work perfectly. In fact, you can just say:
@koncurrencer.created_at = Time.now @koncurrencer.save
and this should work fine.
If you want to always have time at the beginning of the day, you can use Date.today instead of Time.now , since it always returns the Date time component as "00:00:00"
Here is what you want:
@koncurrencer.created_at = Date.today @koncurrencer.save
It should be more clear.
source share