您可以使用Date.parse。对于更复杂的日期字符串,您可以使用strptime函数:require 'date' puts Date.strptime('Mar 31, 1999', '%b %d, %Y') #->1999-03-31 strptime是一种反向的strftime。