You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rpc-dev@xml.apache.org by Jim Redman <ji...@ergotech.com> on 2002/04/15 01:42:40 UTC
I need times accurate to more than 1 second.
The current formatter is fixed:
f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss");
Is there some reason why the milliseconds are not specified? I think
that iso8601 permits this. So we could use the formatter:
f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss.SSS");
and still be in compliance with the spec. Can we add a constructor to
Formatter that takes the string:
/**
* Uses the <code>DateFormat</code> string
* provided.
* @param format the formatting string
*/
public Formatter (String format)
{
f = new SimpleDateFormat (format);
}
Of course this opens something of a can of worms since the client does
not read an iso8601 date, but only one that matches the format string.
The format string happens to match the example in the spec., but that's
only one of a (large) selection of valid formats.
Jim
--
Jim Redman
(505) 662 5156
http://www.ergotech.com
Re:
Posted by John Wilson <tu...@wilson.co.uk>.
----- Original Message -----
From: "Jim Redman" <ji...@ergotech.com>
To: <rp...@xml.apache.org>
Sent: Monday, April 15, 2002 12:42 AM
Subject: <dateTime.iso8601>
> I need times accurate to more than 1 second.
>
> The current formatter is fixed:
>
> f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss");
>
> Is there some reason why the milliseconds are not specified? I think
> that iso8601 permits this. So we could use the formatter:
>
> f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss.SSS");
>
> and still be in compliance with the spec.
Jim,
My understanding of Dave's position on dateTime.iso8601 is that only the
precise subset of dateTime.iso8601 specified is allowed. There is a section
in the Q&A part of the spec which disallows timezone for the same reason.
Personally I think dateTime.iso8601 is close to useless. An int field with
the number of ms since some epoc would be my preferred way of exchanging
time.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
Re:
Posted by John Wilson <tu...@wilson.co.uk>.
----- Original Message -----
From: "Jim Redman" <ji...@ergotech.com>
To: <rp...@xml.apache.org>
Sent: Monday, April 15, 2002 12:42 AM
Subject: <dateTime.iso8601>
> I need times accurate to more than 1 second.
>
> The current formatter is fixed:
>
> f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss");
>
> Is there some reason why the milliseconds are not specified? I think
> that iso8601 permits this. So we could use the formatter:
>
> f = new SimpleDateFormat ("yyyyMMdd'T'HH:mm:ss.SSS");
>
> and still be in compliance with the spec.
Jim,
My understanding of Dave's position on dateTime.iso8601 is that only the
precise subset of dateTime.iso8601 specified is allowed. There is a section
in the Q&A part of the spec which disallows timezone for the same reason.
Personally I think dateTime.iso8601 is close to useless. An int field with
the number of ms since some epoc would be my preferred way of exchanging
time.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk