[Simplog-devel] Timezone support
Brought to you by:
f-bomb
From: Jim Hu <ji...@ta...> - 2005-07-24 18:14:29
|
Based on a recent post to the support bbs, I'm was thinking about taking a look at what patches are needed to make timezone support work in 0.92 (or 1.0). This is to support users who aren't in the same timezone as their servers. But then i started wondering... Should the local time be used everywhere or only when dates and times are displayed? In other words, it seems to me that there are two models: 1) Convert to local time before entering anything into the database 2) Save all the database timestamps as server time, and adjust only on display. I think our current system is by default #1. But I'm not sure that i understand totally how Simplog handles time and date. It seems that there are places where strftime is called that might be redundant ...or not. I'm leaning toward #2...I think it's simpler and better for hosting multiple blogs with users from different locations. Timezone could be stored in the blog_users table or in the blog_list, or recovered somehow from the viewer, depending on what we'd want to see. I think the users who have been posting mostly want their blogs to be at their local time instead of server time, and they're not worried about converting for anonymous readers in other time zones...but I could be wrong about this. But it seems to me that it shouldn't be hard to make each blog have it's own local time. I'm just learning OO thinking, but it seems that in 1.0 perhaps the object classes should be split to improve decoupling. For example, there are input/output/database(persistence?) methods that are shared by entries, comments, and perhaps other things like templates. Each of these uses methods like marker_sub and preview, so they should share an interface object class that does these. Things like handling the time displays would be delegated to the interface classes, and we'd get rid of methods that format the dates in class.BlogEntry. Thoughts? Jim Hu |