Class: Time

Inherits:
Object show all
Defined in:
opal/stdlib/json.rb,
opal/stdlib/time.rb,
opal/stdlib/native.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(str) ⇒ Object



2
3
4
# File 'opal/stdlib/time.rb', line 2

def self.parse(str)
  `new Date(Date.parse(str))`
end

Instance Method Details

#iso8601Object



6
7
8
# File 'opal/stdlib/time.rb', line 6

def iso8601
  strftime('%FT%T%z')
end

#to_jsonObject



195
196
197
# File 'opal/stdlib/json.rb', line 195

def to_json
  strftime('%FT%T%z').to_json
end

#to_nObject



519
520
521
# File 'opal/stdlib/native.rb', line 519

def to_n
  self
end