#!/usr/bin/perl # desc{ round file timestamps to midnight } # # Find every file under the specified directories (or if none # specified, under the current directory), and set the daytime # part of its modtime to 00h00 GMT use strict; #use warnings; BEGIN { $^W = 1} use File::Find; my @to_change; @ARGV = ('.') unless @ARGV; use Cwd; my($mtime, @smh); find( sub { return if $_ eq '.'; if(-f $_) { $mtime = (stat(_))[9]; @smh = ( gmtime($mtime) )[0,1,2]; $mtime -= $smh[0] + ($smh[1] + 60 * $smh[2]) * 60; # bring back to previous midnight utime $^T, $mtime, $_; } }, @ARGV); exit; __END__