request.now = request.utcnow

on top of db.py will make sure internally you have request.utcnow
everwhere.

Then you can set

shift=datetime.timedelta(....)
db.table.field.represent = lambda d,r,s=shift: prettydate(d+s)

for all tables and fields where shift is the localtion-uct time shift.
To compute it you need to know where the visitor it.

On Oct 4, 6:39 pm, TheSweetlink <[email protected]> wrote:
> I want to insert all posts in UTC and convert to local time with
> prettydates.
>
> Either the gluon.tools prettydate() or a JS script I got a hold of
> convert the time properly.
>
> How could I insert a record that is UTC timestamped in the db but
> converted to local timezone when retrieving and viewing the record?
>
> Thanks in advance.
>
> -David

Reply via email to