RE: [Zope3-dev] Formatting dates
That application of the user's timezone might be done before the datetime is actually generated, or with a datetime.replace (tzinfo=ITZInfo(request)) call. (The immutable nature of strings, datetimes, and other similar types doesn't prevent us from performing operations with them or from replacing one attribute value with another, of course). Of course :-) I guess my question was whether you see the widget handling the setting of the time zone, or the application. My vote would be that the widget deal with this, using adaptation to black box the process of finding the implicit tzinfo (assuming the widget doesn't have a UI for explicitly setting it). -- Garrett ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Formatting dates
On 7/21/05, Garrett Smith [EMAIL PROTECTED] wrote: I guess my question was whether you see the widget handling the setting of the time zone, or the application. My vote would be that the widget deal with this, using adaptation to black box the process of finding the implicit tzinfo (assuming the widget doesn't have a UI for explicitly setting it). I'll agree that adaptation should be used to get the implied tzinfo. Whether the widget should be responsible for filling in a tzinfo at all depends on how the application is going to use the value; there should be a way for a field to indicate whether the value contains a tzinfo as well as whether the actual value should be normalized to a specific timezone. It should still be up to the application to specify what kind of timezone handling is needed (via the schema). -Fred -- Fred L. Drake, Jr.fdrake at gmail.com Zope Corporation ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
RE: [Zope3-dev] Formatting dates
-Original Message- From: Fred Drake [mailto:[EMAIL PROTECTED] Sent: Thursday, July 21, 2005 12:25 PM To: Garrett Smith Cc: Zope3-Dev (zope3-dev@zope.org) Subject: Re: [Zope3-dev] Formatting dates On 7/21/05, Garrett Smith [EMAIL PROTECTED] wrote: I guess my question was whether you see the widget handling the setting of the time zone, or the application. My vote would be that the widget deal with this, using adaptation to black box the process of finding the implicit tzinfo (assuming the widget doesn't have a UI for explicitly setting it). I'll agree that adaptation should be used to get the implied tzinfo. Whether the widget should be responsible for filling in a tzinfo at all depends on how the application is going to use the value; there should be a way for a field to indicate whether the value contains a tzinfo as well as whether the actual value should be normalized to a specific timezone. It should still be up to the application to specify what kind of timezone handling is needed (via the schema). Good point -- that should definitely be in the schema. I just want to avoid applying special handing for time zones outside the widget/schema framework. -- Garrett ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Formatting dates
On Jul 19, 2005, at 6:33 PM, Garrett Smith wrote: So this will specifically impact: - The use of date/time formatters - Date/time widgets Anything else? I don't think so. Since datetime values are immutable, I assume you're envisioning that widgets create tz-aware values. With that in mind, I don't understand 'collected timezone-less times from our forms'. Consider the current datetime widgets: we have one that is text- based, and tiks has one (as does ZC--another thing we should all share so too many of us don't have to reinvent wheels) based on the mishoo calendar widget. The mishoo widget is much more friendly than a text-only widget (IMO; take it for argument's sake, at least) but does not collect timezone information (or didn't last time I checked). Therefore, it seems reasonable behavior to declare to a user that their registered timezone will be applied to times they enter for which they do not specify a timezone. That application of the user's timezone might be done before the datetime is actually generated, or with a datetime.replace (tzinfo=ITZInfo(request)) call. (The immutable nature of strings, datetimes, and other similar types doesn't prevent us from performing operations with them or from replacing one attribute value with another, of course). Gary ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Formatting dates
On Jul 19, 2005, at 12:22 AM, Garrett Smith wrote: Now that dates have UTC time zones associated with them, will we be adjusting how they're displayed in various views? Somehow it doesn't seem appropriate to display UTC by default. I'd assume Zope would use the server's timezone offset. Here's an excerpt of me describing our plan for ZC software on IRC, which Stephan has approved for post-3.1 Zope (taken from http:// zope3.pov.lt/irclogs/%23zope3-dev.2005-07-15.log.html): GaryPosterso we already agree on tz-aware storage. My intent is to always expect an adapter of request to tzinfo.20:49 GaryPosterwe plan to have our apps allow specifying tz in the zope 3 preferences stuff20:49 GaryPosterso a logged-in user would have a default timezone20:50 GaryPosterThis would affect collected timezone-less times from our forms,20:50 GaryPosterand affect the astimezone for the display of the stored utc datetimes.20:50 GaryPosterWe're stubbing this for our current apps, since it hasn't been high-priority enough20:51 We go on (in the log) to talk about strategies for unauthenticated users. Gary ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
RE: [Zope3-dev] Formatting dates
So this will specifically impact: - The use of date/time formatters - Date/time widgets Anything else? Since datetime values are immutable, I assume you're envisioning that widgets create tz-aware values. With that in mind, I don't understand 'collected timezone-less times from our forms'. -Original Message- From: Gary Poster [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 19, 2005 11:47 AM To: Garrett Smith Cc: Zope3-Dev (zope3-dev@zope.org) Subject: Re: [Zope3-dev] Formatting dates On Jul 19, 2005, at 12:22 AM, Garrett Smith wrote: Now that dates have UTC time zones associated with them, will we be adjusting how they're displayed in various views? Somehow it doesn't seem appropriate to display UTC by default. I'd assume Zope would use the server's timezone offset. Here's an excerpt of me describing our plan for ZC software on IRC, which Stephan has approved for post-3.1 Zope (taken from http:// zope3.pov.lt/irclogs/%23zope3-dev.2005-07-15.log.html): GaryPosterso we already agree on tz-aware storage. My intent is to always expect an adapter of request to tzinfo.20:49 GaryPosterwe plan to have our apps allow specifying tz in the zope 3 preferences stuff20:49 GaryPosterso a logged-in user would have a default timezone20:50 GaryPosterThis would affect collected timezone-less times from our forms,20:50 GaryPosterand affect the astimezone for the display of the stored utc datetimes.20:50 GaryPosterWe're stubbing this for our current apps, since it hasn't been high-priority enough20:51 We go on (in the log) to talk about strategies for unauthenticated users. Gary ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Formatting dates
Now that dates have UTC time zones associated with them, will we be adjusting how they're displayed in various views? Somehow it doesn't seem appropriate to display UTC by default. I'd assume Zope would use the server's timezone offset. -- Garrett ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com