my $timestamp = 1056360394; my $startofday = $timestamp - ($timestamp % 86400); my $endofday = $startofday + 86400;