Welcome to Community Server Sign in | Join | Help

Standard Date Formats, TimeZones

Gudge writes:

So, if I'd looked at the docs for System.DateTime.ToString I'd have realised that it implements the RFC822 format. All I needed to do was pass "r" as the parameter to ToString. So my code now does that, or will do when it props. And it includes the day of the week, but still says GMT.

Indeed. I can't say why something as RFC822 isn't supported in the framework, but I switched to the "r" RFC1123 the other day and that was getting validated... for pubDate (which is RSS2, which specifies 822). Then I switched out pubDate for the dc core and added dc:date. So back to ISO 8601, "s" works fine for that. Machine readable dates are valid and done (with a conversion to UTC at generate-time).

Display date formats were another matter. I ended up deciding this was the reason to look at Michael Brumm's SimpleTimeZone class. Good stuff. Yeah, it should also probably be present, but I'm still not keen on the namespacing--for now it's still for MS to decide what goes in the System and Microsoft hierarchies (and what's more I'd rather have both the STZ base class and the Win32 Store in a single namespace, single assembly. I'm not high on the assembly per class notion unless there's a great reason (beyond, "I think MS should have included these classes in the Framework").

Which basically means I have mixed feelings over this subtlety. But much thanks to Michael, totally useful classes.

Updated: I recant. I was thinking about this again earlier in a different context and it's not the namespacing that bothers me as much as assembly creep. There are circumstances I can definitely see where you would want to fuse classes into the namespace, something else I was thinking about cemented this home. But I don't think they need to go in a per-extension assembly (but will admit in advance that this is probably a subjective point and is hard to determine in the absence of a specific instance--i.e., I'm not against modularity, just against modularity as the only consideration. I am also pro-puppies.;)

Published Friday, April 04, 2003 7:31 AM by grant
Filed Under:

Comments

No Comments
Anonymous comments are disabled