#!/usr/bin/perl

# Tagelichtschwelle
$schwelle = 30;
$t = 0;
$[ = 1;                 # set array base to 1

while(<>){
($wd,$mon,$day,$zeit,$year,$solar,$ldr,@rest) = split(' ', $_);
if ($t == 0 && $ldr > $schwelle) {
	$t = 1;
	@auf = split(/:/, $zeit);
}
if ($t == 1 && $ldr < $schwelle) {
	$t = 0;
	@unter = split(/:/, $zeit);
    print $day, " ", $mon, "\t", ($unter[1] - $auf[1]) * 60 + $unter[2] - $auf[2],"\n";
}
}