File Coverage

blib/lib/Date/Format.pm
Criterion Covered Total %
statement 12 16 75.0
branch 2 2 100.0
condition n/a
subroutine 4 6 66.6
pod 4 4 100.0
total 22 28 78.5


line stmt bran cond sub pod time code
1             # Copyright (c) 1995-2009 Graham Barr. This program is free
2             # software; you can redistribute it and/or modify it under the same terms
3             # as Perl itself.
4              
5             package Date::Format;
6              
7 14     14   747609 use strict;
  14         28  
  14         917  
8             require Exporter;
9              
10             our $VERSION = '2.35'; # VERSION: generated
11             # ABSTRACT: Date formatting subroutines
12              
13 14     14   3711 use Date::Format::Generic;
  14         40  
  14         3616  
14              
15             our @ISA = qw(Exporter);
16             our @EXPORT = qw(time2str strftime ctime asctime);
17              
18             sub time2str ($;$$$)
19             {
20 163     163 1 1261823 my ($fmt, $time, $zone, $lang) = @_;
21             my $pkg = defined $lang
22 163 100       358 ? do { require Date::Language; Date::Language->new($lang) }
  6         475  
  6         21  
23             : 'Date::Format::Generic';
24 163         617 $pkg->time2str($fmt, $time, $zone);
25             }
26              
27             sub strftime ($\@;$)
28             {
29 5     5 1 383273 Date::Format::Generic->strftime(@_);
30             }
31              
32             sub ctime ($;$)
33             {
34 0     0 1   my ($t,$tz) = @_;
35 0           Date::Format::Generic->time2str("%a %b %e %T %Y\n", $t, $tz);
36             }
37              
38             sub asctime (\@;$)
39             {
40 0     0 1   my ($t,$tz) = @_;
41 0           Date::Format::Generic->strftime("%a %b %e %T %Y\n", $t, $tz);
42             }
43              
44             1;
45              
46             __END__