develooper Front page | perl.beginners | Postings from January 2002

comparing dates

Thread Next
From:
Alex Harris
Date:
January 7, 2002 08:39
Subject:
comparing dates
Message ID:
F5dTVQ6GKKbG6Qkd7FS0001451b@hotmail.com


if I use the following to get the date of a file:
    use File::stat;
    use Time::localtime;
    $date_string = ctime(stat($file)->mtime);
    print "file $file updated at $date_string\n";

I get:
   Mon Jan  7 10:21:21 2002

Now I want to compare another file date to this one getting the date the 
same way but I don't understand the following example:

    sub getdate {
	local($_) = shift;
	s/-(\d{4})$/+$1/ || s/\+(\d{4})$/-$1/;
	    # getdate has broken timezone sign reversal!
	$_ = `/usr/local/lib/news/newsbin/getdate '$_'`;
	chop;
	$_;
    }

I can't use c modules because they haven't been added and I don't have 
permissions.  TIA

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About