1PFT::Date(3)          User Contributed Perl Documentation         PFT::Date(3)
2
3
4

NAME

6       PFT::Date - Representation of date
7

SYNOPSIS

9           PFT::Date->new(2016, 12, 10)
10
11           PFT::Date->from_spec(
12               d => 12,
13               m => 'june', # human friendly
14               # missing ones (e.g. year) filled with today's year.
15           )
16
17           PFT::Date->from_string('1955-11-05');
18

DESCRIPTION

20       "PFT::Date" is defined as a blessed array reference. The first element
21       is the year, the second is the month, the third is the day.
22
23   Properties
24       y   Year getter
25
26       m   Month getter
27
28       d   Day getter
29
30       to_hash
31           Returns a dictionary in the form
32
33               { y => ..., m => ..., d => ... }
34
35       repr
36           Returns a string representing the date. Optional parameter is a
37           separator string, by default '-'
38
39               PFT::Date->new(1,2,3)->repr      eq '0001-02-03'
40               PFT::Date->new(1,2,3)->repr('/') eq '0001/02/03'
41
42       derive
43           Returns a copy of the PFT::Date object with the provided components
44           replaced.
45
46               PFT::Date->new(1, 2, 3)->derive(m => undef)
47
48           is like
49
50               PFT::Date->new(1, undef, 3)
51
52       complete
53           Check if the date is complete of year, month and day.
54
55
56
57perl v5.36.0                      2023-01-20                      PFT::Date(3)
Impressum