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



181
182
183
# File 'opal/stdlib/json.rb', line 181

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

#to_nObject



446
447
448
# File 'opal/stdlib/native.rb', line 446

def to_n
  self
end