Return-Path: Delivered-To: apmail-incubator-abdera-user-archive@locus.apache.org Received: (qmail 40439 invoked from network); 9 Jan 2008 03:55:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2008 03:55:26 -0000 Received: (qmail 7373 invoked by uid 500); 9 Jan 2008 03:55:15 -0000 Delivered-To: apmail-incubator-abdera-user-archive@incubator.apache.org Received: (qmail 7349 invoked by uid 500); 9 Jan 2008 03:55:15 -0000 Mailing-List: contact abdera-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-user@incubator.apache.org Delivered-To: mailing list abdera-user@incubator.apache.org Received: (qmail 7340 invoked by uid 99); 9 Jan 2008 03:55:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 19:55:15 -0800 X-ASF-Spam-Status: No, hits=3.8 required=10.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chriswberry@gmail.com designates 209.85.132.249 as permitted sender) Received: from [209.85.132.249] (HELO an-out-0708.google.com) (209.85.132.249) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2008 03:54:51 +0000 Received: by an-out-0708.google.com with SMTP id b33so18736ana.83 for ; Tue, 08 Jan 2008 19:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; bh=i4NsOGG5PcGwhCPypMnX4zc6uerN2DPZ2rVMuktwJVQ=; b=vhIPRkKXJWBY7/SQ0sVg3YpMNGib1+4NgRX3m3rAdvSL0oHTk7D7IDeL2mcRlTcCUn1xCERH+GPitm7KXwXTKP2CI7Socrc9HfZIAwRQioEy9g8349VdjqflOK+i8X8suaaNkptmyZZOMjYvbtA8OLGfUvofd6lyN0M+yx/CVw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=gkNFNh44FsLGPzXIOaXQ7Gw6gHaFHA6fDPqIt3BQw6OrCy9ywEfvMqb6Tk5IdOEP+REMftj3Uf01bOrI3iD4Gc6pQAzlJe3wM/DYojQ8UeeS5TkeCdhLXoud5RwyZVqZmgiMSz0XpWfTZlqAdlsos8lbvERY1YP6COFADHyHknY= Received: by 10.101.71.16 with SMTP id y16mr486735ank.50.1199850895745; Tue, 08 Jan 2008 19:54:55 -0800 (PST) Received: from ?192.168.1.3? ( [72.179.45.126]) by mx.google.com with ESMTPS id m10sm608353rnd.15.2008.01.08.19.54.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2008 19:54:54 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753) To: Abdera User Message-Id: <3DA4BE28-A44D-4ED8-B749-E41052BBC002@gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-11-352860453 From: Chris Berry Subject: AtomDate Date: Tue, 8 Jan 2008 21:54:36 -0600 X-Mailer: Apple Mail (2.753) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-11-352860453 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Greetings, The AtomDate class is not adhering to the RFC3339 spec (see below) IIRC, this is somewhat by design?? But unfortunately, it its current state the regex PATTERN in AtomDate private static final Pattern PATTERN = Pattern.compile( "(\\d{4})(?:-(\\d{2}))?(?:-(\\d{2}))?(?:[Tt](?:(\\d{2}))?(?::(\ \d{2}))?(?::(\\d{2}))?(?:\\.(\\d{3}))?)?([Zz])?(?:([+-])(\\d{2}):(\\d {2}))?"); allows dates like this:: "12012007" to be interpreted as:: '1200-12-31 18:00:00.0' in the CST timezone. Obviously the caller should have used "20071201". But it seems to me that Abdera should be strict about these dates (and adhere strictly to the spec)?? (e.g. "2007-12-01") Otherwise these dates (and thus, errors) can slip through the cracks. (In my case to be rejected eventually by the database) So you could use something like this; private static final Pattern PATTERN = Pattern.compile( "(\\d{4})-(\\d{2})-(\\d{2})?(?:[Tt](?:(\\d{2}))?(?::(\\d{2}))? (?::(\\d{2}))?(?:\\.(\\d{3}))?)?([Zz])?(?:([+-])(\\d{2}):(\\d{2}))?"); Or better, if you want to be even more specific and restrict month and day numbers correctly... private static final Pattern PATTERN = Pattern.compile( "((?:19|20)\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])?(?: [Tt](?:(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(?:\\.(\\d{3}))?)?([Zz])? (?:([+-])(\\d{2}):(\\d{2}))?"); NOTE: I have not entirely corrected PATTERN. Only the Date portion. Thanks, -- Chris ====================================== RFC 3339 Date and Time on the Internet: Timestamps July 2002 5.6. Internet Date/Time Format The following profile of ISO 8601 [ISO8601] dates SHOULD be used in new protocols on the Internet. This is specified using the syntax description notation defined in [ABNF]. date-fullyear = 4DIGIT date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on ; month/year time-hour = 2DIGIT ; 00-23 time-minute = 2DIGIT ; 00-59 time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second ; rules time-secfrac = "." 1*DIGIT time-numoffset = ("+" / "-") time-hour ":" time-minute time-offset = "Z" / time-numoffset partial-time = time-hour ":" time-minute ":" time-second [time-secfrac] full-date = date-fullyear "-" date-month "-" date-mday full-time = partial-time time-offset date-time = full-date "T" full-time NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this syntax may alternatively be lower case "t" or "z" respectively. This date/time format may be used in some environments or contexts that distinguish between the upper- and lower-case letters 'A'-'Z' and 'a'-'z' (e.g. XML). Specifications that use this format in such environments MAY further limit the date/time syntax so that the letters 'T' and 'Z' used in the date/time syntax must always be upper case. Applications that generate this format SHOULD use upper case letters. NOTE: ISO 8601 defines date and time separated by "T". Applications using this syntax may choose, for the sake of readability, to specify a full-date and full-time separated by (say) a space character. S'all good --- chriswberry at gmail dot com --Apple-Mail-11-352860453--