Date-EzDate

 view release on metacpan or  search on metacpan

t/test.t  view on Meta::CPAN

#------------------------------------------------------



#------------------------------------------------------
# check epoch days around the epoch
#
do {
	my (@timevalues);
	my $name = 'check epoch days around the epoch';
	my $iterations = 10;
	
	# check if this system can handle negative epoch values
	@timevalues = localtime(-1);
	
	# skip block:
	SKIP: {
		# skip section
		if (! @timevalues) {
			skip 'this system cannot handle dates before the epoch', $iterations;
		}
		
		# variables
		my ($date, $control, @timevalues);
		
		# get date object and control day
		$date = Date::EzDate->new('Jan 4, 1970 5pm');
		$control = $date->{'epoch day'};
		
		foreach my $i (0..$iterations) {
			err_comp(
				$date->{'epoch day'},
				$control,
				"$name: iteration $i",
			);
			
			$control--;
			$date->{'epoch day'}--;
		}
	}



( run in 0.651 second using v1.01-cache-2.11-cpan-71847e10f99 )