title: Ruby loses millisecond somewhere
body: <p>I'm trying to add milliseconds for some timestamps. It seems that there are some milliseconds getting lost somewhere.</p>
  
  <pre><code>input:    00:00:36,040
  expected: 00:00:37,040
  output:   00:00:37,039
  </code></pre>
  
  <p>Any ideas?</p>
  
  <pre><code>puts Timestamp.new("00:00:36,040").add("1,000").to_string
  
  class Timestamp
  
    def initialize(instr)
       h, m, s, l = instr.split(/[:,]/).map { |x| x.to_i }
       @time = Time.at(h*3600 + m*60 + s + l*0.001 ) - Time.new.utc_offset
    end
  
    def to_string
      @time.strftime("%H:%M:%S,%L")
    end
  end
  </code></pre>