Date & Time
James Ashley <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
Not sure whether willg had anything to do with this mail or not. I'm still trying to figure out the fine details of thunderbird. Sorry if this post is mangled. (I *think* I'm sending it out text-only, but it doesn't look that way. I'm really wondering about the wisdom of leaving mutt). also sprach will guaraldi <[email protected]> [2005.07.25.1806 +0200]: > Also, could you include a variable $timezone. I am currently simply > doing > import time > py['timezone'] = time.tzname[time.localtime()[8]] It's been my experience that the python modules dealing with time are just evil. When I forget and use them, I wind up jumping through all kinds of nasty hoops trying to get things to work right. Query the database, get a time in one format. Convert that into a tuple the time module recognizes, then use some function to convert that to something the datetime module can recognize. Then another method to convert *that* to something human-readable. Or something at least that obnoxious. It's almost like messing with C again <shudder>. Just use mx. If you possibly can. Really, you'll be much happier. (I have a program that runs a few hundred different threads, at slightly randomized times. It does all those date calculations I mentioned above. Every few days I run across a stack trace from a thread that didn't quite do things right. I unit-tested the LL34 out of this thing, but I still missed some bugs that should have been really obvious. I don't know how I missed them. Using mx would have solved pretty much all these bugs up-front. I don't understand why this module isn't part of the core distribution, unless maybe someone's going through some silly ego trip, like with python's TkInter obsession). > to get it. > Note that we also need RFC 822 dates for RSS2. The w3cdate plugin > does not work for this. I actually have no idea what the problem > is... ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click