Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/rcap/extensions/time.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) to_s_for_cap

Returns a string representaion of the time suitable for CAP.

Examples:

Time.now.to_s_for_cap # => "2011-10-26T21:45:00+02:00"

Returns:



7
8
9
10
# File 'lib/rcap/extensions/time.rb', line 7

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