From: Ferdous ara Date: 2012-11-12T03:04:03+09:00 Subject: Convert date to string Hi i have seen couple of example of convert the date to string. but dont understand how to use that in my example remote_date=`cat #{file} | grep -m 1 'Current time:' | awk {'print $3'}` remote_time =`cat #{file} | grep -m 1 'Current time:' | awk {'print $4'}` puts remote_date ::::2012-11-11 puts remote_time :::: 17:57:05 current_date=`date +%Y-%m-%d` current_time=`date +%H:%M:%S` if remote_date.to_s == current_date then puts "Date is same" else puts "Time differences found" end puts current_date :::2012-11-11 puts current_time :::17:57:11 Basically, want i want is : if current time is 1 min or less then 1 min different then remote time everything is fine, but more then 1 min difference is a problem any help will be great. it would be great if i can do this without installing any ruby module (which have to install ) thanks -- Posted via http://www.ruby-forum.com/.