Hi,
date = [‘15/10/1971’, ‘16/10/1972’, ‘12/12/1971’]
real = date.map {|s| Date.parse s}
puts real.sort
Could anyone please tell me how I can parse the date in this sort with
a European format?
Thanks
Aidy
Hi,
date = [‘15/10/1971’, ‘16/10/1972’, ‘12/12/1971’]
real = date.map {|s| Date.parse s}
puts real.sort
Could anyone please tell me how I can parse the date in this sort with
a European format?
Thanks
Aidy
On Mon, Jun 8, 2009 at 11:45 AM, aidy[email protected] wrote:
Hi,
date = [‘15/10/1971’, ‘16/10/1972’, ‘12/12/1971’]
real = date.map {|s| Date.parse s}
puts real.sortCould anyone please tell me how I can parse the date in this sort with
a European format?
real = date.map {|s| Date.strptime(s, “%d/%m/%Y”)}
–
Rick DeNatale
Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs