File Coverage

blib/lib/SQL/Statement/Function/ByName/SECOND.pm
Criterion Covered Total %
statement 11 11 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package SQL::Statement::Function::ByName::SECOND;
2              
3 1     1   2766 use 5.010001;
  1         4  
4 1     1   6 use strict;
  1         2  
  1         21  
5 1     1   6 use warnings;
  1         2  
  1         156  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2022-12-12'; # DATE
9             our $DIST = 'SQL-Statement-Functions-Date'; # DIST
10             our $VERSION = '0.050'; # VERSION
11              
12             sub SQL_FUNCTION_SECOND {
13 4     4 0 19 my $param = $_[2];
14              
15 4 100       24 $param =~ /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:(\d{2})/ or return undef; ## no critic: TestingAndDebugging::ProhibitExplicitReturnUndef
16 2         11 $1;
17             }
18              
19             1;
20             # ABSTRACT: Return the second part (00-60) of a date/datetime expression
21              
22             __END__