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   645761 use strict;
  14         25  
  14         845  
8             require Exporter;
9              
10             our $VERSION = '2.34_03'; # TRIAL VERSION: generated
11             # ABSTRACT: Date formatting subroutines
12              
13 14     14   3992 use Date::Format::Generic;
  14         39  
  14         3444  
14              
15             our @ISA = qw(Exporter);
16             our @EXPORT = qw(time2str strftime ctime asctime);
17              
18             sub time2str ($;$$$)
19             {
20 163     163 1 1174031 my ($fmt, $time, $zone, $lang) = @_;
21             my $pkg = defined $lang
22 163 100       332 ? do { require Date::Language; Date::Language->new($lang) }
  6         521  
  6         21  
23             : 'Date::Format::Generic';
24 163         772 $pkg->time2str($fmt, $time, $zone);
25             }
26              
27             sub strftime ($\@;$)
28             {
29 5     5 1 492642 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__