On Aug 27, 2005, at 5:07 PM, Joel VanderWerf wrote: > > Is there a way to use Time#strftime to generate a string that contains > milliseconds, and to do so in such a way that Time.parse > understands it? > > In other words, a value of ms_format that makes this work: > > t_now = Time.at(1125180070.216) > diff = Time.parse(t_now.strftime(ms_format)) - t_now > diff.abs < 0.001 # ==> true > > The default format does not represent milliseconds, so the diff can be > up to 1.0: > > default_format = "%a %b %d %H:%M:%S %Z %Y" > t_now = Time.at(1125180070.216) > diff = Time.parse(t_now.strftime(default_format)) - t_now > p diff.abs # => 0.216 This may not exactly answer your question, but you you parse with strptime() instead? James Edward Gray II