← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:12 2021

Filename/usr/local/lib/perl5/site_perl/Mail/Field/Date.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sMail::Field::Date::::BEGIN@10Mail::Field::Date::BEGIN@10
0000s0sMail::Field::Date::::BEGIN@13Mail::Field::Date::BEGIN@13
0000s0sMail::Field::Date::::BEGIN@15Mail::Field::Date::BEGIN@15
0000s0sMail::Field::Date::::BEGIN@17Mail::Field::Date::BEGIN@17
0000s0sMail::Field::Date::::BEGIN@18Mail::Field::Date::BEGIN@18
0000s0sMail::Field::Date::::parseMail::Field::Date::parse
0000s0sMail::Field::Date::::reformatMail::Field::Date::reformat
0000s0sMail::Field::Date::::setMail::Field::Date::set
0000s0sMail::Field::Date::::stringifyMail::Field::Date::stringify
0000s0sMail::Field::Date::::timeMail::Field::Date::time
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Copyrights 1995-2019 by [Mark Overmeer <markov@cpan.org>].
2# For other contributors see ChangeLog.
3# See the manual pages for details on the licensing terms.
4# Pod stripped from pm file by OODoc 2.02.
5# This code is part of the bundle MailTools. Meta-POD processed with
6# OODoc into POD and HTML manual-pages. See README.md for Copyright.
7# Licensed under the same terms as Perl itself.
8
9package Mail::Field::Date;
10use vars '$VERSION';
11$VERSION = '2.21';
12
13use base 'Mail::Field';
14
15use strict;
16
17use Date::Format qw(time2str);
18use Date::Parse qw(str2time);
19
20(bless [])->register('Date');
21
22
23sub set()
24{ my $self = shift;
25 my $arg = @_ == 1 ? shift : { @_ };
26
27 foreach my $s (qw(Time TimeStr))
28 { if(exists $arg->{$s})
29 { $self->{$s} = $arg->{$s} }
30 else { delete $self->{$s} }
31 }
32
33 $self;
34}
35
36sub parse($)
37{ my $self = shift;
38 delete $self->{Time};
39 $self->{TimeStr} = shift;
40 $self;
41}
42
43
44sub time(;$)
45{ my $self = shift;
46
47 if(@_)
48 { delete $self->{TimeStr};
49 return $self->{Time} = shift;
50 }
51
52 $self->{Time} ||= str2time $self->{TimeStr};
53}
54
55sub stringify
56{ my $self = shift;
57 $self->{TimeStr} ||= time2str("%a, %e %b %Y %T %z", $self->time);
58}
59
60sub reformat
61{ my $self = shift;
62 $self->time($self->time);
63 $self->stringify;
64}
65
661;