From: sto.mar@... Date: 2012-08-04T23:35:35+09:00 Subject: Re: %Q of DateTime#strftime not working Am 04.08.2012 02:45, schrieb Jingjing Duan: > The rdoc says the following about the %Q directive: > > %Q - Number of microseconds since 1970-01-01 00:00:00 UTC. > > However, it seems to return the number of milliseconds instead. > > 1.9.3p194 :067 > now = DateTime.now > => # ((2456144j,2590s,721033000n),-25200s,2299161j)> > 1.9.3p194 :068 > now.strftime("%s") > => "1344040990" > 1.9.3p194 :069 > now.strftime("%Q") > => "1344040990721" > 1.9.3p194 :070 > now.to_time.usec > => 721033 > > As you can tell, the 'now' object does have microsecond accuracy. So why > doesn't %Q work as advertised? > It's a bug in the documentation, it should read "Number of milliseconds". I already submitted a patch. --