ヤミRoot VoidGate
User / IP
:
216.73.216.2
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
.cpanm
/
work
/
1568630761.27314
/
DateTime-1.51
/
t
/
Viewing: 22from-doy.t
use strict; use warnings; use Test::Fatal; use Test::More; use DateTime; my @last_day = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); my @leap_last_day = @last_day; $leap_last_day[1]++; { my $doy = 15; foreach my $month ( 1 .. 12 ) { $doy += $last_day[ $month - 2 ] if $month > 1; my $dt = DateTime->from_day_of_year( year => 2001, day_of_year => $doy, time_zone => 'UTC', ); is( $dt->year, 2001, 'check year' ); is( $dt->month, $month, 'check month' ); is( $dt->day, 15, 'check day' ); is( $dt->day_of_year, $doy, 'check day of year' ); } } { my $doy = 15; foreach my $month ( 1 .. 12 ) { $doy += $leap_last_day[ $month - 2 ] if $month > 1; my $dt = DateTime->from_day_of_year( year => 2004, day_of_year => $doy, time_zone => 'UTC', ); is( $dt->year, 2004, 'check year' ); is( $dt->month, $month, 'check month' ); is( $dt->day, 15, 'check day' ); is( $dt->day_of_year, $doy, 'check day of year' ); } } { like( exception { DateTime->from_day_of_year( year => 2001, day_of_year => 366 ) }, qr/2001 is not a leap year/, 'Cannot give day of year 366 in non-leap years' ); is( exception { DateTime->from_day_of_year( year => 2004, day_of_year => 366 ) }, undef, 'Day of year 366 should work in leap years' ); } done_testing();
Coded With 💗 by
0x6ick