Return to Snippet

Revision: 47543
at June 9, 2011 19:22 by stancox


Initial Code
class Time  
  def to_js # to javascript, ie: "2007-06-09T14:23:11", usage: new Date("<%= Time.now.to_js %>")  
     self.strftime("%Y-%m-%dT%H:%M:%S")  
  end  
end

Initial URL
http://blog.hulihanapplications.com/browse/view/58-ruby-time-to-javascript

Initial Description

                                

Initial Title
ruby time to javascript

Initial Tags
date

Initial Language
Ruby