Re: File.mtime <=> DateTime.strptime()
- From: "Ara.T.Howard" <Ara.T.Howard@xxxxxxxx>
- Date: Fri, 9 Sep 2005 06:24:16 +0900
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 useBut 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 ===============================================================================
.
- Follow-Ups:
- Re: File.mtime <=> DateTime.strptime()
- From: Hugh Sasse
- Re: File.mtime <=> DateTime.strptime()
- References:
- File.mtime <=> DateTime.strptime()
- From: Hugh Sasse
- Re: File.mtime <=> DateTime.strptime()
- From: Ara.T.Howard
- Re: File.mtime <=> DateTime.strptime()
- From: Hugh Sasse
- File.mtime <=> DateTime.strptime()
- Prev by Date: Re: Lexical Casts with Ruby
- Next by Date: Re: Lexical Casts with Ruby
- Previous by thread: Re: File.mtime <=> DateTime.strptime()
- Next by thread: Re: File.mtime <=> DateTime.strptime()
- Index(es):
Relevant Pages
|
Loading