I want to store created_on and modified_on values of all tables in UTC format. Audit fields are added using db._common_fields.append(auth.signature) and in auth.signature default value for created_on and modified_on is request.now, I want to change it to request.utcnow. So I tried following but its now working, it is still storing server time, not in UTC.
auth.signature.created_on.default = request.utcnow
auth.signature.modified_on.default = request.utcnow
db._common_fields.append(auth.signature)
I am able to change default value to utc by explicitly defining it for each table like this
db.table_name.field_name.created_on.default = request.utcnow
db.table_name.field_name.modified_on.default = request.utcnow
But I don't want to repeat same thing for all tables.
So how can I override default values of modified_on and created_on with minimum lines of code?
My next task is to show record creation date/time according to user's timezone.
Thank You
- Gaurav Vichare