[ create a new paste ] login | about

Link: http://codepad.org/NRzqiJT3    [ raw code | output | fork ]

Ruby, pasted on Jan 23:
1
2
3
4
5
6
7
8
9
10
require 'rubygems'
require 'active_support'

class DateTime
  def as_json(options = nil)
    strftime('%Y/%m/%dT%H:%M:%S%z')
  end
end

puts DateTime.civil(2012,2,3,4,5,6).as_json


Output:
1
2012/02/03T04:05:06+0000


Create a new paste based on this one


Comments: