I would like to know how a timezone by any place would be done, so I look
forward to your article. For me I am just going to keep it set to
US/Central. Also if anyone wants to use the code I have provided to build
this sort of web app for the general public, please feel free to use what I
have provided.
On Friday, July 8, 2016 at 8:16:46 AM UTC-5, Marlysson Silva wrote:
>
>
> Are you trying to get the timezone just of the your location?
> Case yes, you set your timezone at code, and deploy in pythonanywhere with
> value personal of the timezone.
>
> But you want timezone by any place, then I go prepare a article showing
> what I made to solved this.
>
> Em sexta-feira, 8 de julho de 2016 09:56:48 UTC-3, Jeff Riley escreveu:
>>
>> Just in case anyone is wondering why I would build such a strange little
>> web app, it is for my personal use. I was dianosed with brain cancer 6
>> weeks ago and these are the items my doctors want me to track everyday. So
>> I thought Web2py would be perfect.
>>
>> On Thursday, July 7, 2016 at 2:19:10 PM UTC-5, Jeff Riley wrote:
>>>
>>> Hello all. Me again. I have run into an interesting issue. I have
>>> installed and followed niphlod's w2p_timezone_plugin. In order to make it
>>> work on my local PC I need to setup my db.py as follows.
>>>
>>> import pytz
>>> user_timezone = session.plugin_timezone_tx or 'UTC'
>>>
>>>
>>> db.define_table('events',
>>> Field('event_time', 'datetime', default = request.now,
>>> update = request.now,
>>> requires=IS_DATETIME(format=('%m-%d-%Y %H:%M'),
>>> timezone=pytz.timezone(user_timezone))),
>>>
>>>
>>> But to get it to work on pythonanywhere.com I have to setup my db.py as
>>> follows. Any ideas why?
>>>
>>>
>>> import pytz
>>>
>>> db.define_table('events',
>>> Field('event_time', 'datetime', default = request.now,
>>> update = request.now,
>>> requires=IS_DATETIME(format=('%m-%d-%Y %H:%M'),
>>> timezone=pytz.timezone("US/Central"))),
>>>
>>>
>>>
>>>
--
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].
For more options, visit https://groups.google.com/d/optout.