Class: Time

Inherits:
Object show all
Defined in:
/Users/elia/Code/opal-docs/opal/stdlib/json.rb,
/Users/elia/Code/opal-docs/opal/stdlib/time.rb,
/Users/elia/Code/opal-docs/opal/stdlib/native.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(str) ⇒ Object


2
3
4
# File '/Users/elia/Code/opal-docs/opal/stdlib/time.rb', line 2

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

Instance Method Details

#iso8601Object


6
7
8
# File '/Users/elia/Code/opal-docs/opal/stdlib/time.rb', line 6

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

#to_jsonObject


181
182
183
# File '/Users/elia/Code/opal-docs/opal/stdlib/json.rb', line 181

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

#to_nObject

Public: Returns itself (an instance of Date).


517
518
519
# File '/Users/elia/Code/opal-docs/opal/stdlib/native.rb', line 517

def to_n
  self
end