RFC-822 dates into Ruby dates
Whats the right way in Ruby to pull these kind of dates apart into a
Mon, 8 Aug 2005 16:25:00 GMT
I'm working on parsing several RSS feeds and storing the data in
change nospam into yahoo
Re: RFC-822 dates into Ruby dates
On Jun 8, 6:12*pm, kellygreer1 <kellygre...@yahoo.com> wrote:
> Whats the right way in Ruby to pull these kind of dates apart into a
> Ruby Date?
> Mon, 8 Aug 2005 16:25:00 GMT
The DateTime class (in library 'date') can parse those strings.
d = DateTime.parse("Mon, 8 Aug 2005 16:25:00 GMT")
# and so forth... *or*
puts d.strftime "%Y %H %Z"
Hope that helps,
LearnRuby.com offers Rails & Ruby HANDS-ON public & ON-SITE
Ruby Fundamentals Wkshp June 16-18 Ann Arbor, Mich.
Ready for Rails Ruby Wkshp June 23-24 Ann Arbor, Mich.
Ruby on Rails Wkshp June 25-27 Ann Arbor, Mich.
Ruby Plus Rails Combo Wkshp June 23-27 Ann Arbor, Mich
Please visit http://LearnRuby.com for all the details.
|All times are GMT. The time now is 12:54 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.