users@jersey.java.net

Re: [Jersey] Bug in Jersey's header parser?

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Mon, 3 Nov 2008 06:55:55 -0800 (PST)

   Julian, he wrote one *day* earlier. Paul, for what it's worth this seems
to work fine under Java6 update 10. If there was a bug it seems to have been
fixed:

toString: Sat Feb 01 00:00:00 EST 2003
  format: Sat, 01 Feb 2003 05:00:00 GMT

Gili


Julian Reschke wrote:
>
> Paul Sandoz wrote:
>> ...
>> Jersey defers to a SimpleDateFormat instance for RFC 1123:
>>
>> SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy
>> HH:mm:ss zzz", Locale.US);
>> TimeZone tz = TimeZone.getTimeZone("GMT");
>> sdf.setTimeZone(tz);
>>
>> GregorianCalendar d = new GregorianCalendar(2003,
>> Calendar.FEBRUARY, 1);
>>
>> System.out.println("toString: " + d.getTime().toString());
>> System.out.println(" format: " + sdf.format(d.getTime()));
>>
>> It looks like the setting of the time zone to GMT causes the date to be
>> formated one day earlier. From the HTTP spec the time zone must be GMT
>> [1]. Is this a bug in the date formatting code?
>> ...
>
> Hmm, is this a trick question? It's just one hour earlier, right?
>
> Doesn't the answer just depend on the time difference between GMT, and
> the VM's default locale (used by GregorianCalendar)?
>
> BR, Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>

-- 
View this message in context: http://n2.nabble.com/Re%3A-Bug-in-Jersey%27s-header-parser--tp581274p1449753.html
Sent from the Jersey mailing list archive at Nabble.com.