> What if server > is in East Kazakhstan and the user is in Hackensack, New Jersey? What > time zone is request.now?)
If the server and user are in different time zones I don't believe there's an easy solution, especially when you consider daylight saving time (i.e. just converting everything to UTC probably isn't enough). I'm using fixed_datetime.py in my modules directory. http://blog.twinapex.fi/2008/06/30/relativity-of-time-shortcomings-in-python-datetime-and-workaround/ which I has a processing overhead that may not be acceptable to you. In my situation all times are entered and presented in the same time zone, so I've put set_default_timezone("Europe/London") near the bottom of fixed_datetime.py. Then in my model I call now = datetime.now() and that returns the current time in London even though the server is in the USA. I use this 'now' to see if times are in the future etc. I store all the times in my database as if they're London times. It would probably be cleaner to use datetime.utcnow() as 'now', store times as UTC, store user's time zone and convert times before they are presented to the user. Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---