File: D8.pm

package info (click to toggle)
libdate-simple-perl 3.0300-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 184 kB
  • sloc: perl: 570; makefile: 3
file content (47 lines) | stat: -rwxr-xr-x 937 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package Date::Simple::D8;
use Date::Simple 3;
use base qw/Date::Simple/;
use overload '""' => 'as_d8';

*EXPORT      = *Date::Simple::EXPORT;
*EXPORT_OK   = *Date::Simple::EXPORT_OK;
*EXPORT_TAGS = *Date::Simple::EXPORT_TAGS;

sub d8    { shift->_d8(@_) }
sub today { shift->_today(@_) }
sub ymd   { shift->_ymd(@_) }

1;

=head1 NAME

Date::Simple::D8 - Sub class of Date::Simple with eight digit date style formatting
as default.

=head1 SYNOPSIS

    use Date::Simple::D8;

=head1 DESCRIPTION

This module changes the default stringification behaviour of Date::Simple objects to
use the as_d8() method instead.

=over

=item Date::Simple::D8->new ([ARG, ...])

=item date_d8 ([ARG, ...])

Identical to Date::Simple except that uses the D8 style formatting ('%Y%m%d') for
overloaded stringification or when not providing a format argument to the format()
method.

=back

=head1 SEE ALSO

L<Date::Simple> for full documentation.

=cut