datetime - How do you convert YYYY-MM-DDTHH:MM:SSZ time format to MM/DD/YYYY time format in Ruby? -


for example, i'm trying convert 2011-01-19t00:00:00z 01/19/2011. what's simplest way of accomplishing this?

you can use time.parse parse time string time object. can use strftime turn string format like:

require 'time' time.parse("2011-01-19t00:00:00z").strftime("%m/%d/%y") #=> "01/19/2011" 

Comments

Popular posts from this blog

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

c# - Add item to Generic List / Collection using reflection -