Thread Differenz in Jahren zwischen zwei Datem ("Datums") (5 answers)
Opened by Gast at 2013-10-24 14:27

Gast wer
 2013-10-25 11:31
#171472 #171472
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;

my $date_ok = 0;
                
my $day_birth = "28";
my $month_birth = "12";
my $year_birth = "2009";

my $day_p_date = "28";
my $month_p_date = "11";
my $year_p_date = "2013";

my $date_diff=sprintf('%04u%02u%02u',$year_p_date,$month_p_date,$day_p_date)-sprintf('%04u%02u%02u',$year_birth,$month_birth,$day_birth);
$date_ok=1 if($date_diff > sprintf('%04u%02u%02u',4,0,0) and $date_diff <= sprintf('%04u%02u%02u',5,0,0));

print "$date_ok\n";

Last edited: 2013-10-25 11:39:48 +0200 (CEST)

View full thread Differenz in Jahren zwischen zwei Datem ("Datums")