Split string into words

Hi I am new to Ruby
I am trying to split a string.
Example I have string 2013-12-01T00:00:00+11:00 and I only want to get
the date
I’ve been looking at the split() method but not sure what the delimiter
will be in this case ?? Can someone please help me here. Thanks

why not using the time parse functions?

require “time”
Time.parse(“2013-12-01T00:00:00+11:00”).to_date.to_s #=> “2013-12-01”

Jade CKS wrote in post #1152740:

Hi I am new to Ruby
I am trying to split a string.
Example I have string 2013-12-01T00:00:00+11:00 and I only want to get
the date
I’ve been looking at the split() method but not sure what the delimiter
will be in this case ??

“2013-12-01T00:00:00+11:00”.split(‘T’)[0]

Thank you Hans and Regis for your reply. I actually manage to get the
date using the slice() method
But I want to try the time parse function. Thanks for your help guys