i'm using attribute named :subscription_active_untill
in user table, type datetime
, i'm trying save datetime stamp in not being saved. example, executing current command in rails console
user.find(3).update(:subscription_active_untill => 1473363930)
it returns true
in console when see record using user.find(3)
:subscription_active_untill
attribute still nill
. issue?
note: can update other attribute of same record without issue, problem specific attribute.
the issue has been solved, above trying save wrong format datetime (i.e. unix timestamp format). had convert correct format. so, doing following commands saves attribute correctly.
user.find(3).update(:subscription_active_untill => 2016-09-08 20:14:30 utc)
to convert unix timestamo utc format can use following code:
time.at(1473363930).utc
Comments
Post a Comment