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
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
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”
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs