Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 35120 invoked from network); 26 Jan 2007 14:47:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jan 2007 14:47:56 -0000 Received: (qmail 69086 invoked by uid 500); 26 Jan 2007 14:47:56 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 69011 invoked by uid 500); 26 Jan 2007 14:47:55 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 69000 invoked by uid 99); 26 Jan 2007 14:47:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jan 2007 06:47:55 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dion.gillard@gmail.com designates 64.233.184.235 as permitted sender) Received: from [64.233.184.235] (HELO wr-out-0506.google.com) (64.233.184.235) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jan 2007 06:47:47 -0800 Received: by wr-out-0506.google.com with SMTP id 69so685773wra for ; Fri, 26 Jan 2007 06:47:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dy2qztweAKdSKEfZRzEjcqFqfDeeszFZQMX6XqHnJCalkAEIsm4VSLeYBh63gC/LXZ1/BVfj6rhMFtHU9WIyiWSl6IztfFzB7fiNXB549otQWmnbR7d0ekkFOF/RdhwyApTaZ2R7HsCKZfxgR+qv8eK3bMjTvc7f3JKQMQ/KKjk= Received: by 10.78.193.19 with SMTP id q19mr2308302huf.1169822844633; Fri, 26 Jan 2007 06:47:24 -0800 (PST) Received: by 10.78.46.20 with HTTP; Fri, 26 Jan 2007 06:47:24 -0800 (PST) Message-ID: Date: Sat, 27 Jan 2007 01:47:24 +1100 From: "Dion Gillard" To: "Jakarta Commons Users List" Subject: Re: [jelly] How to build a date object with current time in GMT? In-Reply-To: <0C260F619E428642BFA6380177C3ADF304A0788F@exmsea005.us.wamu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <0C260F619E428642BFA6380177C3ADF304A077C1@exmsea005.us.wamu.net> <0C260F619E428642BFA6380177C3ADF304A0788F@exmsea005.us.wamu.net> X-Virus-Checked: Checked by ClamAV on apache.org On 1/27/07, Karr, David wrote: > Below. > > -----Original Message----- > > From: Dion Gillard [mailto:dion.gillard@gmail.com] > > Sent: Friday, January 26, 2007 3:18 AM > > To: Jakarta Commons Users List > > Subject: Re: [jelly] How to build a date object with current > > time in GMT? > > > > On 1/26/07, Karr, David wrote: > > > I have a Jelly script that puts the current time into a string. It > > > works ok, but I'm realizing I need to convert the time to > > GMT before > > > putting it into the string. It's straightforward to do > > this in Java, > > > but I'm having trouble figuring out how to do this in the > > limited Java > > > syntax in Jelly. > > > > > > In Java, I might do something like this: > > > > > > Calendar calendar = Calendar.getInstance(); > > calendar.setTimeZone(TimeZone.getTimeZone(TimeZone.getAvailableIDs(0)[ > > > 0] > > > )); > > > date gmtDate = calendar.getDate(); > > > > > > In Jelly, I think I can get close, but part of what I'm > > doing doesn't > > > work. > > > > > > ---------- > > > > > var="calendar"/> > > > > method="getAvailableIDs" > > > var="timezones"> > > > > > > > > > > > > > > > > > > > Not sure why you're doing this....assuming it's to get timezones[0] > > > > > > > > > > > > How about (untried) > > > > > > > > ? > > That would probably be better, but both of these fail with the same > "argument type mismatch" error. I wonder whether the "${timezone}" > reference tries to produce a String instead of a TimeZone object? > > > > ---------- > > > > > > I get an unhelpful "argument type mismatch" error on the > > "setProperties" > > > element. I added "log:info" elements along the way to verify I was > > > getting reasonable values (like the value for "timezone" resulting > > > from the "forEach" loop). > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > Try dumping out: ${timezones[0].class.name} -- http://www.multitask.com.au/people/dion/ Rule of Acquisition #91: Hear all, trust nothing. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org