use strict;
use POSIX;
use File::stat;

# returns an RFC822 timestamp.  If no argument, for right now
#
sub rfc822
{
    my $t = shift;
    $t = time unless $t;
    my $rfc822 = "%a, %d %b %G %T %Z";
    return POSIX::strftime($rfc822, localtime($t));
}

# returns the RFC822 last-modified time for a file
#
sub rfc822_file
{
    my $fn = shift;
    my $s = stat($fn);
    return &rfc822($s->mtime);
}

1;
