<feed xmlns="http://www.w3.org/2005/Atom" xmlns:foaf="http://xmlns.com/foaf/0.1/"><title>norman.walsh.name: Comments on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates"/><id>http://norman.walsh.name/2004/04/06/cvsdates/comments.atom</id><updated>2012-02-13T10:08:41.833385Z</updated><entry><title>Comment 1 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0001"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0001</id><published>2004-04-07T01:31:53Z</published><updated>2004-04-07T01:31:53Z</updated><author><name>Nasseam Elkarra</name></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>It would make more sense to convert the CVS date/time to a standard ISO 8601 date/time. The ISO date/time is more API friendly for parsing, converting, etc. whereas the CVS date/time is quite the opposite. ISO is also more consistent with the rest of the date/time formats on your site (DocBook pubdate, Dublin Core dates).</p>
<p>Here's the regex to do it:</p>
<p>Regex:
\$Date:\s(?&amp;lt;year&amp;gt;\d{4})/(?&amp;lt;month&amp;gt;\d{2})/(?&amp;lt;day&amp;gt;\d{2})\s(?&amp;lt;hour&amp;gt;\d{2}):(?&amp;lt;minutes&amp;gt;\d{2}):(?&amp;lt;seconds&amp;gt;\d{2})\s\$</p>
<p>Replace with:
${year}-${month}-${day}T${hour}:${minutes}:${seconds}Z</p>
  </div></content></entry><entry><title>Comment 2 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0002"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0002</id><published>2004-04-07T11:31:05Z</published><updated>2004-04-07T11:31:05Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>I agree that it would be better to have the date in the right format, but the question is, who does the replacement? CVS isn't going to, the validator (a standard validator anyway) isn't going to, and it seems awfully heavyweight to add a whole new transformation step into the validation process for this purpose.</p>
<p>Now, if we had a pipeline processing language,...sigh.</p>
  </div></content></entry><entry><title>Comment 3 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0003"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0003</id><published>2004-04-07T11:47:09Z</published><updated>2004-04-07T11:47:09Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>By the way, what language is that regex in?</p>
  </div></content></entry><entry><title>Comment 4 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0004"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0004</id><published>2004-04-07T14:45:14Z</published><updated>2004-04-07T14:45:14Z</updated><author><name>Fred Drake</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>I'd say that's the Perl syntax, with a twist.  The twist is that I'd spell (?&amp;lt;name&amp;gt;pattern) as (?P&amp;lt;name&amp;gt;pattern); maybe that's what was intended.  (The same RE syntax is used for Python's "re" module.)</p>
  </div></content></entry><entry><title>Comment 5 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0005"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0005</id><published>2004-04-07T15:40:38Z</published><updated>2004-04-07T15:40:38Z</updated><author><name>Jirka Kosek</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>I personally don't like idea that &amp;lt;date&amp;gt; element is typed as xs:date. I usally write date in a human friendly format and localized. WXS datatypes doesn't even provide facility for localized date/time formats. I would prefer date as xs:string, so I can write something like &amp;lt;date&amp;gt;7. dubna 2004&amp;lt;/date&amp;gt;, or &amp;lt;date&amp;gt;April 7th 2004&amp;lt;/date&amp;gt; in English.</p>
<p>DocBook is text based format and text formats are very loosely typed. I think that there is not much sense in typing element's contents in DocBook as there always will be people for who the rules are too stricts. I think that in DocBook schema is reasonable to assign types only to several attributes -- like making cols attribute on tgroup xs:int, or even xs:positiveInt.</p>
  </div></content></entry><entry><title>Comment 6 on /2004/04/06/cvsdates</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/04/06/cvsdates#comment0006"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0006</id><published>2004-04-28T16:05:47Z</published><updated>2004-04-28T16:05:47Z</updated><author><name>Paul Heinlein</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>I'm not sure restricting the syntax of dates is a great idea, but if you're going to deal with CVS dates, then it'd probably be worthwhile to support RCS as well. Here's a sample</p>
<p>$Date: 2004-04-28 09:00:27-07 $</p>
<p>1. Dashes, not slashes are used as ymd delimiters.</p>
<p>2. It provides timezone support; e.g., the trailing '-07' indicates PDT.</p>
  </div></content></entry></feed>

