On Thu, 2011-04-21 at 09:38 -0400, Jay Dobies wrote: > So you're suggesting we take a time submitted from TZ A (the caller) > and > convert it to TZ B (the server) and store that in the DB? What happens > on the server on the days where daylights saving flips, do we need > some > sort of task to run around updating things we've stored or is that > applied when it's pulled out of the DB again?
> I'm not sure I follow how that's easier than converting to UTC, though > I > don't actually have a strong opinion either way. > > I'm going to guess that storing the local time will make logging a > whole > lot easier since we can just log the value and not have to rely on the > log file reader to convert a UTC stamp. That sort of thing could save > a > ton of time debugging if the logs were easily readable like that. > Again > though, that's a guess and I may be missing something. Let me look into this a little deeper. I know that to use the date/time fields of most things, we'll have to convert them to the local timezone. Also, I don't really want to make people think in utc. If they want a repo synced at 3am everyday, in my opinion, pulp should take 3am to mean in its local timezone and not have to do any wonky utc conversions on either side. That said, storing date/time in utc in database would make the data more "normalized". Since there in no notion of daylight savings time in utc, it would be easier to accommodate it on the pulp server. Here's what I'm thinking: I want to look into pymongo's hooks. I know that we're using their json encoding/decoding hooks already. I think (without much research) that we can override the date/time serialization to convert to/from is8601 format to python's standard datetime and timedelta objects. I'll see if there's something similar for storing and retrieving them to/from the mongo database. This would be the place to handle timezones and daylight savings time, if at all possible. It'd be pretty sweet to get these conversions happening automatically. I'll report back in a day or so... In the meantime: thoughts? -- Jason L Connor linear on freenode #pulp http://pulpproject.org/ RHCE: 805010912355231 GPG Fingerprint: 2048R/CC4ED7C1
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Pulp-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/pulp-list
