method
json_create
ruby latest stable - Class:
Time
json_create(object)public
# File ext/json/lib/json/add/time.rb, line 9
def self.json_create(object)
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
object['n'] = usec * 1000
end
if method_defined?(:tv_nsec)
at(object['s'], Rational(object['n'], 1000))
else
at(object['s'], object['n'] / 1000)
end
end Related methods
- Instance methods
- +
- -
- <=>
- as_json
- asctime
- ctime
- day
- dst?
- eql?
- friday?
- getgm
- getlocal
- getutc
- gmt?
- gmt_offset
- gmtime
- gmtoff
- hash
- hour
- httpdate
- initialize_copy
- inspect
- isdst
- iso8601
- localtime
- mday
- min
- mon
- monday?
- month
- nsec
- rfc2822
- rfc822
- round
- saturday?
- sec
- strftime
- subsec
- succ
- sunday?
- thursday?
- to_a
- to_date
- to_datetime
- to_f
- to_i
- to_json
- to_r
- to_s
- to_time
- tuesday?
- tv_nsec
- tv_sec
- tv_usec
- usec
- utc
- utc?
- utc_offset
- w3cdtf
- wday
- wednesday?
- xmlschema
- yday
- year
- zone
- Class methods
- at
- gm
- httpdate
- iso8601
- json_create
- local
- mktime
- new
- now
- parse
- rfc2822
- rfc822
- strptime
- utc
- w3cdtf
- xmlschema
- zone_offset
- Private methods
-
apply_offset -
force_zone! -
make_time -
month_days -
zone_utc? -
_dump -
marshal_dump -
marshal_load