[#10193] String.ord — David Flanagan <david@...>

Hi,

41 messages 2007/02/05
[#10197] Re: String.ord — Yukihiro Matsumoto <matz@...> 2007/02/06

Hi,

[#10198] Re: String.ord — David Flanagan <david@...> 2007/02/06

Yukihiro Matsumoto wrote:

[#10199] Re: String.ord — Daniel Berger <djberg96@...> 2007/02/06

David Flanagan wrote:

[#10200] Re: String.ord — David Flanagan <david@...> 2007/02/06

Daniel Berger wrote:

[#10208] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10213] Re: String.ord — David Flanagan <david@...> 2007/02/06

Nikolai Weibull wrote:

[#10215] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10216] Re: String.ord — David Flanagan <david@...> 2007/02/07

Nikolai Weibull wrote:

[#10288] Socket library should support abstract unix sockets — <noreply@...>

Bugs item #8597, was opened at 2007-02-13 16:10

12 messages 2007/02/13

[#10321] File.basename fails on Windows root paths — <noreply@...>

Bugs item #8676, was opened at 2007-02-15 10:09

11 messages 2007/02/15

[#10323] Trouble with xmlrpc — James Edward Gray II <james@...>

Some of the Ruby code used by TextMate makes use of xmlrpc/

31 messages 2007/02/15
[#10324] Re: Trouble with xmlrpc — "Berger, Daniel" <Daniel.Berger@...> 2007/02/15

> -----Original Message-----

[#10326] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/15

On Feb 15, 2007, at 1:29 PM, Berger, Daniel wrote:

[#10342] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

While I am complaining about xmlrpc, we have another issue. It's

[#10343] Re: Trouble with xmlrpc — Alex Young <alex@...> 2007/02/16

James Edward Gray II wrote:

[#10344] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

On Feb 16, 2007, at 12:08 PM, Alex Young wrote:

Re: Trouble with xmlrpc

From: Sam Roberts <sroberts@...>
Date: 2007-02-17 03:32:13 UTC
List: ruby-core #10355
Quoting james@grayproductions.net, on Sat, Feb 17, 2007 at 07:45:44AM +0900:
> On Feb 16, 2007, at 4:17 PM, Sam Roberts wrote:
> >>Currently we send the time without any time-zone information.  It's
> >>hard to see this as useful in anyway.  There is no way to add a time-
> >>zone to the iso 8601 field the spec calls for either.
> >
> >Why do you say that? Isn't the format of the dateTime.iso8601 field
> >that defined by ISO 8601?
> 
> I'm sorry.  I wasn't very clear on that point.  The XML-RPC spec
> calls for a particular format of an ISO 8601 date:
> 19980717T14:08:55.

The entirety of the specs description of dateTime.iso8601 is this:

   Tag                Type      Example
   [... other data types...]
   <dateTime.iso8601> date/time 19980717T14:08:55

and I don't see why any sensible person would read that example, and think that
a single example somehow suffices to indicate that the date format is called
ISO 8601, but isn't ISO 8601.

Still, its a horridly vague excuse for a "specification", the important thing
is probably, what do implementations actually do?

As one example, ruby's xml-rpc, code you quoted in a seperate message, does
this:

      when /^(-?\d\d\d\d)-?(\d\d)-?(\d\d)T(\d\d):(\d\d):(\d\d)(?:Z|([+-])(\d\d):?(\d\d))?$/
        a = [$1, $2, $3, $4, $5, $6].collect{|i| i.to_i}
        if $7
          ofs = $8.to_i*3600 + $9.to_i*60
          ofs = -ofs if $7=='+'
          utc = Time.utc(a.reverse) + ofs
          a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]

That code clearly (and correctly) handles ISO 8601 date times, including
variants with timezones!

Unfortunately, the code in create.rb doesn't similarly handle timezones, for
some reason, perhaps it should?

Sam

Index: lib/xmlrpc/create.rb
===================================================================
--- lib/xmlrpc/create.rb        (revision 11477)
+++ lib/xmlrpc/create.rb        (working copy)
@@ -7,6 +7,7 @@
 #
 
 require "date"
+require "time"
 require "xmlrpc/base64"
 
 module XMLRPC
@@ -241,9 +242,12 @@
            @writer.ele("data", *a)
          )
 
-       when Time, Date
-         @writer.tag("dateTime.iso8601", param.strftime("%Y%m%dT%H:%M:%S"))  
+       when Date
+          @writer.tag("dateTime.iso8601", param.strftime("%Y%m%dT%H:%M:%S"))
 
+       when Time
+         @writer.tag("dateTime.iso8601", param.iso8601)
+
        when XMLRPC::DateTime
          @writer.tag("dateTime.iso8601", 
            format("%.4d%02d%02dT%02d:%02d:%02d", *param.to_a))


In This Thread