Posts tagged 'time'

Plone/Zope: Truncating a Data.fs back to a certain date/time

Okay. So, anyone out here who’s listening — particularly those overly-enthusiastic users — don’t try to recursively wget your Plone site (or other CMS, for that matter) whilst you’re logged in with an account that can make edits. It will lead to a very bad situation where your site administrator and technical team need to step in and fix your mistakes. For the uninitiated, a loose recursive wget (when logged in with some degree of Edit rights) will hit every link that’s on your pages, and I mean in the (X)HTML source. For a Plone site, this …

Linux: Make time with faketime

So you, like me, have hit a situation where you’ve got a time-sensitive application that won’t run? Maybe you’ve downloaded one of those apps (like a demo) that won’t run after a certain date and time because it’s “expired”. Or else, maybe some other arbitrary time constraint is keeping you from running a Linux (or even Windows) program. On Linux (Ubuntu for me), there’s faketime to the rescue - a very handy tool that does what it says on the box, changes the system time for given command.

After installing faketime by something like:

sudo …

DateTime in Python/Zope/Plone is painful

Alright, now for today’s problem:  why do two dates that look different when outputted actually end up being the same date?

Answer: I’m not sure, but I’m pretty sure it’s got something to do with the wacky support the above-mentioned 3 products have for timezones.

The background: Plone stores a DateTime object to record a user’s last login time.  It doesn’t really matter what’s purpose is, because Plone (this time) isn’t at fault.  The DateTime gets stored, no worries.  The problem arises when you try to put that value back into a …