From: Marcin Wolski Date: 2010-05-18T20:58:21+09:00 Subject: Re: how to add time to date Lucky Nl wrote: > Hi , > Am using javascript calender to select date.am saving same date into > mydatabase . > but it's saving as 2010-18-05 00-00-00 > can amybody help to add time to existed date > and it should be like 2010-18-05 11:59:00. > > can anybody help Maybe the following will be helpful: irb(main):011:0> s="2010-18-05 00-00-00" => "2010-18-05 00-00-00" irb(main):012:0> t = Time.now.strftime("%H-%M-%S") => "19-57-11" irb(main):013:0> s[-8..-1] = Time.now.strftime("%H:%M:%S") => "19:57:18" irb(main):014:0> s => "2010-18-05 19:57:18" -- Posted via http://www.ruby-forum.com/.