Sha256: 62b5c326bb7fbdd3d93579cfe12489b6de7b98097fd6a9096dc0118d828cfe90

Contents?: true

Size: 507 Bytes

Versions: 4

Compression:

Stored size: 507 Bytes

Contents

module Savon
  module CoreExt
    module Time

      # Returns an xs:dateTime formatted String.
      def xs_datetime
        zone = if utc_offset < 0
          "-#{"%02d" % (- utc_offset / 3600)}:#{"%02d" % ((- utc_offset % 3600) / 60)}"
        elsif utc_offset > 0
          "+#{"%02d" % (utc_offset / 3600)}:#{"%02d" % ((utc_offset % 3600) / 60)}"
        else
          "Z"
        end

        strftime "%Y-%m-%dT%H:%M:%S#{zone}"
      end

    end
  end
end

Time.send :include, Savon::CoreExt::Time

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
savon-0.9.4 lib/savon/core_ext/time.rb
savon-0.9.3 lib/savon/core_ext/time.rb
search_biomodel-1.0.0 search_biomodel/ruby/1.8/gems/savon-0.9.2/lib/savon/core_ext/time.rb
savon-0.9.2 lib/savon/core_ext/time.rb