From users-return-180014-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Thu May 15 16:11:37 2008 Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 24481 invoked from network); 15 May 2008 16:11:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 16:11:37 -0000 Received: (qmail 23754 invoked by uid 500); 15 May 2008 16:11:25 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 23731 invoked by uid 500); 15 May 2008 16:11:25 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 23720 invoked by uid 99); 15 May 2008 16:11:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 09:11:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.20.54.33] (HELO server2.livestoryboard.com) (69.20.54.33) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 16:10:29 +0000 Received: from [192.168.2.9] (c-24-128-47-98.hsd1.nh.comcast.net [24.128.47.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server2.livestoryboard.com (Postfix) with ESMTP id 50B692BEA09 for ; Thu, 15 May 2008 12:10:50 -0400 (EDT) Subject: Re: [OT] Parsing xs:dateTime values From: Robert Koberg Reply-To: rob@koberg.com To: Tomcat Users List In-Reply-To: <482C5E34.8090901@christopherschultz.net> References: <482C5E34.8090901@christopherschultz.net> Content-Type: text/plain Organization: liveSTORYBOARD Date: Thu, 15 May 2008 12:10:56 -0400 Message-Id: <1210867856.19650.72.camel@rkoberg-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, You don't need regexp. Do you mean something like: private static final String ISO8601_DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss"; private static final java.text.SimpleDateFormat ISO8601 = new java.text.SimpleDateFormat( ISO8601_DATEFORMAT, java.util.Locale.US); public static final Date getDateFromIso8601(final String iso8601) throws ParseException { return ISO8601.parse(iso8601); } best, -Rob On Thu, 2008-05-15 at 12:00 -0400, Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > All, > > I posted this on the commons-user mailing list, but I'm not getting any > love. I'm cross-posting to see if anyone on this list might have any > good ideas. > > | Hi, I'm looking for an implementation of a String->Date converter for > | xs:dateTime, which has an odd format. It's not directly supportable by > | java.text.SimpleDateFormat and looks like a regular expression is the > | only way to go. > | > | Does anyone have an implementation they'd care to share, or any tips in > | particular? I'd be glad to share whatever I come up with if there isn't > | anything already out there. > > My existing implementation uses regular expressions, which seems a bit > overkill. > > Thanks, > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkgsXdIACgkQ9CaO5/Lv0PAZawCffPNDLZ3bXczy89Cm1ptDzu1E > va4AnRjfICMeUROWQGI40ts3CwZXtEOB > =dDWw > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org