I'm building a Rails App where I want to convert some database entries to timestamps. Trouble is that they are in the format yyyy-mm-dd which gives this wrong timestamp:
irb(main):005:0> Date.new(2014-05-14).to_time.to_i * 1000
=> 788914800000
Instead I want something like this:
irb(main):006:0> Date.new(2014,05,14).to_time.to_i * 1000
=> 1400018400000
So how do I go about doing that in Ruby?
I've looked at this thread, but although helpful, it doesn't really solve my problem.