Sha256: cf345d712c39543cdc4e55df420d81fbc85fe34029857d24bbd68939698f5c39

Contents?: true

Size: 322 Bytes

Versions: 3

Compression:

Stored size: 322 Bytes

Contents

class Time # :nodoc:
  RCAP_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
  RCAP_ZONE_FORMAT = "%+03i:00"

  def to_s_for_cap
    t = self.strftime( RCAP_TIME_FORMAT ) + format( RCAP_ZONE_FORMAT , utc_hours_offset )
    t.sub(/\+(00:\d\d)$/, '-\1')
  end

  private
  def utc_hours_offset
    self.localtime.utc_offset/3600
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rcap-1.3.0 lib/extensions/time.rb
rcap-1.2.4 lib/extensions/time.rb
rcap-1.2.3 lib/extensions/time.rb