From: "Ara.T.Howard" Date: 2005-09-09T06:24:16+09:00 Subject: Re: File.mtime <=> DateTime.strptime() On Fri, 9 Sep 2005, Hugh Sasse wrote: > On Fri, 9 Sep 2005, Ara.T.Howard wrote: > >> On Fri, 9 Sep 2005, Hugh Sasse wrote: >> >>> I'm trying to compare how new a file is with the header obtained >>> from Net::HTTP.head(). I use > [...] >>> But I can't compare this with the results of File.mtime, because one >>> is a DateTime, and one is a Time. Time::strptime or Time::strftime >> >> this might help... >> >> harp:~ > cat a.rb >> require 'alib' > > What is alib? ara's lib ;-) it's a holding place for all the utility methods i don't end up putting anywhere else. i also have inlined some small, but very useful code developed by other people like satoru takabayashi's bsearch code for built-in arrays. it's a mix of useful stuff like - Util : lot's of time/string/process/filesystem/tmpdir-file/hash manipulation routines - Main : utilities for whipping out simple and configurable (via yaml file) main programs that support usage, logging, command line and option parsing in seconds - Bsearch : bsearch support for arrays - OrderedHash : name says it all basically it's my personal stash of stuff i can't live without. get it here http://codeforpeople.com/lib/ruby/alib/ > I think it depends on whenther I can get both times into the same form. to form those methods use is iso-8601 - should be a peice of cake. cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================