Thread Datumstermine ermitteln
(18 answers)
Opened by la_dy82 at 2011-01-19 15:13
Ich würde DateTime verwenden:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #!/usr/bin/perl use strict; use warnings; use DateTime; my $start = '2010.12.01'; my %date; @date{qw/year month day/} = split /\./, $start; my $start_obj = DateTime->new( %date ); my $end_obj = DateTime->now; my $counter = 1; while ( $start_obj <= $end_obj ) { print "$counter: ", $start_obj->ymd('.'),"\n"; $start_obj->add( days => 1 ); $counter++; } Ausgabe: Code: (dl
)
1 1: 2010.12.01 OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |