Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby string to date

str = "Tue, 10 Aug 2010 01:20:19 +0400"
puts Date.parse str
2010-08-10
puts Date.parse(Time.parse(str).utc.to_s)
2010-08-09

Or simply
Time.zone.parse(str) # using Time with zone is a good rule of thumb
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #string #date
ADD COMMENT
Topic
Name
2+3 =