From: Hassan Schroeder Date: 2012-11-12T03:27:41+09:00 Subject: Re: Convert date to string On Sun, Nov 11, 2012 at 10:04 AM, Ferdous ara wrote: > i have seen couple of example of convert the date to string. but dont > understand how to use that in my example Why would you want to? For your use case it's easier to compare actual DateTime objects than strings. Look at the docs for Date, DateTime and Time in the stdlib. 1.9.3 (main):0 > t2 = DateTime.new(2012, 11, 11, 9, 1, 2) => # 1.9.3 (main):0 > t1 = DateTime.new(2012, 11, 11, 9, 1, 1) => # 1.9.3 (main):0 > t2.to_time - t1.to_time => 1.0 -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan