I have a string, the value of this string is an rss date. I want to convert the value of this string / the rss date into another format (MM-DD-YY HH:MM). Any ideas how to do this?
This is an extract of what I got so far…
#!/usr/bin/env ruby
require 'rss/2.0'
require 'rss/content'
[...]
date = rss.items[i].pubDate
date = #Here I want to convert the date
puts date
[...]
Use
Date.parseto get aDateobject from a string and thenDate#strftimeto format it correctly.Here’s a
strftimeexample: