Il 20/09/10 17.21, Ruwan Budha ha scritto:
> Hi all,
>
> I have following two time stamps,
>
> 12:35:10:757& 12:35:10:759
>
> I want to convert them to ruby time and find the time difference.
>
> which is a 2 micro seconds.
>
Simply:
require 'time'
mT=Time.utc(2010,9,20,12,35,10,757)
=> Mon Sep 20 12:35:10 UTC 2010
mT1=Time.utc(2010,9,20,12,35,10,759)
=> Mon Sep 20 12:35:10 UTC 2010
mT1-mT
=> 2.0e-06
> I would appreciate any help..
>
> thanks in advance
>
You're welcome, but before ask, try to google a bit...[1]
[1]
http://ruby-doc.org/core/classes/Time.html#M000252