On Saturday, June 29, 2019 at 8:21:17 PM UTC-7, mostwanted wrote: > > Hi guys, my application is being hosted on pythonanywhere, when i retrieve > user inputs and their created_on date & timestamps to display them the > timestamps come different from the time of my location. We are 2hrs ahead, > is there a way i can have these timestamps similar to the that of my time > zone?? > > Regards > > Mostwanted >
Take a look at the python datetime module, and functions such as datetime. astimezone(*tz*). <URL:https://docs.python.org/2/library/datetime.html#datetime-objects> If you need to detect timezones on your client, that can be tricky, but there is a discussion from 2013 in the archives. Also a strong suggestion to always store UTC, whatever you display it as. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/cb4bafc1-e02a-4dc7-be18-c4c5ae629c0c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

