blib/lib/Time/Piece/Guess.pm

filter: Statementstmt 24.2% 40 / 165 Branchbran 25.2% 54 / 214 Conditioncond 22.2% 4 / 18 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 25.5% 106 / 415 CC 114 SCAR 81.9
CC
114
Cov
25%
guess
4568.2
guess_to_object
195.2
BEGIN
1.0
CRAP 3606.3
↑ Summary
1 package Time::Piece::Guess;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Time::Piece;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Time::Piece::Guess - Compares the passed string against common patterns and returns a format to use with Time::Piece or object
11  
12 =head1 VERSION
13  
14 Version 0.1.1
15  
16 =cut
17  
18 2 our $VERSION = '0.1.1';
19  
20 =head1 SYNOPSIS
21  
22 use Time::Piece::Guess;
23 use Time::Piece;
24  
25 my $string='2023-02-27T11:00:18.33';
26 my ($format, $ms_clean_regex) = Time::Piece::Guess->guess('2023-02-27T11:00:18');
27 # apply the regex if needed
28 if (defined( $ms_clean_regex )){
29 $string=~s/$ms_clean_regex//;
30 }
31 my $tp_object;
32 if (!defined( $format )){
33 print "No matching format found\n";
34 }else{
35 $tp_object = Time::Piece->strptime( '2023-02-27T11:00:18' , $format );
36 }
37  
38 $tp_object = Time::Piece::Guess->guess_to_object('2023-02-27T11:00:18');
39 if (!defined( $tp_object )){
40 print "No matching format found\n";
41 }
42  
43 =head1 METHODS
44  
45 =head2 guess
46  
47 Compares it against various patterns and returns the matching string for use with
48 parsing that format.
49  
50 If one can't be matched, undef is returned. Two values are returned. The first is the format
51 of it and the second is a regexp to remove microseconds if needed.
52  
53 This will attempt to remove microseconds as below.
54  
55 my $string='2023-02-27T11:00:18.33';
56 my ($format, $ms_clean_regex) = Time::Piece::Guess->guess('2023-02-27T11:00:18');
57 # apply the regex if needed
58 if (defined( $ms_clean_regex )){
59 $string=~s/$ms_clean_regex//;
60 }
61 my $tp_object;
62 if (!defined( $format )){
63 print "No matching format found\n";
64 }else{
65 $tp_object = Time::Piece->strptime( '2023-02-27T11:00:18' , $format );
66 }
67  
68  
69 Worth noting that Time::Piece as of the writing of this has a bug in which if just hours
70 are present for %z and minutes are not it will error.
71  
72 if ($format =~ /\%z/ && $string =~ /[-+]\d\d$/) {
73 sstring=$string.'00';
74 }
75  
76  
77 =cut
78  
79 3 ▶sub guess {
Subroutine guess: called CC=93 SCAR=84.3
Pod documented
80 3 my $string = $_[1];
81  
82 3 ▶ if ( !defined($string) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $string) 0 3 3
83 0 return undef;
84 }
85  
86 # remove micro seconds if they are present
87 3 my $regex;
88 3 ▶ if ( $string =~ /\.\d+/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($string =~ /\.\d+/) 1 2 3
89 1 $regex = qr/\.\d+/;
90 1 $string =~ s/$regex//;
91 }
92  
93 3 my $format;
94 3 ▶ if ( $string =~ /^\d+$/ ) {
Branch: 90 branches
BranchTrueFalseTotal
if ($string =~ /^\d+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]Z$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\ .+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]Z$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\ .+$/) { } 0 3 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/) { } 2 1 3
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9][-+]\d+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]Z$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]\ .+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$]) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]Z$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\ .+$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/) { } 0 1 1
elsif ($string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 1 1
elsif ($string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]Z$/) { } 0 1 1
elsif ($string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\ .+$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9][-+]\d+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]Z$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]\ .+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$]) { } 0 1 1
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$]) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]$/) { } 0 1 1
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/) { } 1 0 1
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$]) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$]) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]\ .+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]\ .+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]\ .+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]\ .+$/) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9][-+]\d+$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9]Z$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9]\ .+$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9][0-5][0-9]Z$]) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]Z$/) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9][-+]\d+$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9]Z$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9][0-5][0-9]Z$]) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9]$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\-\d\d-\d\d/[0-2][0-9][0-5][0-9][0-5][0-9]$]) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]$/) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9]$]) { } 0 0 0
elsif ($string =~ m[^\d\d\d\d\d\d\d\d/[0-2][0-9][0-5][0-9][0-5][0-9]$]) { } 0 0 0
95 0 $format = '%s';
96 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
97 0 $format = '%Y-%m-%d %H:%M%z';
98 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]Z$/ ) {
99 0 $format = '%Y-%m-%d %H:%MZ';
100 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
101 0 $format = '%Y-%m-%d %H:%M %Z';
102 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
103 0 $format = '%Y-%m-%d %H:%M:%S%z';
104 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
105 0 $format = '%Y-%m-%d %H:%M:%SZ';
106 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
107 0 $format = '%Y-%m-%d %H:%M:%S %Z';
108 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
109 0 $format = '%Y-%m-%dT%H:%M%z';
110 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]Z$/ ) {
111 0 $format = '%Y-%m-%dT%H:%MZ';
112 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
113 0 $format = '%Y-%m-%dT%H:%M %Z';
114 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
115 2 $format = '%Y-%m-%dT%H:%M:%S%z';
116 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
117 0 $format = '%Y-%m-%dT%H:%M:%SZ';
118 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
119 0 $format = '%Y-%m-%dT%H:%M:%S %Z';
120 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
121 0 $format = '%Y-%m-%dT%H:%M%z';
122 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]Z$/ ) {
123 0 $format = '%Y-%m-%dT%H:%MZ';
124 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
125 0 $format = '%Y-%m-%dT%H:%M %Z';
126 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
127 0 $format = '%Y-%m-%d/%H:%M:%S%z';
128 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
129 0 $format = '%Y-%m-%d/%H:%M:%SZ';
130 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
131 0 $format = '%Y-%m-%d/%H:%M:%S %Z';
132 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
133 0 $format = '%Y%m%d %H:%M%z';
134 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]Z$/ ) {
135 0 $format = '%Y%m%d %H:%M%Z';
136 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
137 0 $format = '%Y%m%d %H:%M %Z';
138 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
139 0 $format = '%Y%m%d %H:%M:%S%z';
140 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
141 0 $format = '%Y%m%d %H:%M:%SZ';
142 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
143 0 $format = '%Y%m%d %H:%M:%S %Z';
144 } elsif ( $string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
145 0 $format = '%Y%m%dT%H:%M%z';
146 } elsif ( $string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]Z$/ ) {
147 0 $format = '%Y%m%dT%H:%MZ';
148 } elsif ( $string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
149 0 $format = '%Y%m%dT%H:%M %Z';
150 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
151 0 $format = '%Y%m%dT%H:%M:%S%z';
152 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
153 0 $format = '%Y%m%dT%H:%M:%SZ';
154 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
155 0 $format = '%Y%m%dT%H:%M:%S %Z';
156 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9][-+]\d+$/ ) {
157 0 $format = '%Y%m%dT%H:%M%z';
158 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]Z$/ ) {
159 0 $format = '%Y%m%dT%H:%MZ';
160 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]\ .+$/ ) {
161 0 $format = '%Y%m%dT%H:%M %Z';
162 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9][-+]\d+$/ ) {
163 0 $format = '%Y%m%d/%H:%M:%S%z';
164 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]Z$/ ) {
165 0 $format = '%Y%m%d/%H:%M:%SZ';
166 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\ .+$/ ) {
167 0 $format = '%Y%m%d/%H:%M:%S %Z';
168 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]$/ ) {
169 0 $format = '%Y-%m-%d %H:%M';
170 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
171 0 $format = '%Y-%m-%d %H:%M:%S';
172 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]$/ ) {
173 0 $format = '%Y-%m-%dT%H:%M';
174 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
175 1 $format = '%Y-%m-%dT%H:%M:%S';
176 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]$/ ) {
177 0 $format = '%Y-%m-%dT%H:%M';
178 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
179 0 $format = '%Y-%m-%d/%H:%M:%S';
180 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]$/ ) {
181 0 $format = '%Y%m%d %H:%M';
182 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
183 0 $format = '%Y%m%d %H:%M:%S';
184 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]$/ ) {
185 0 $format = '%Y%m%dT%H:%M';
186 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
187 0 $format = '%Y%m%dT%H:%M:%S';
188 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]$/ ) {
189 0 $format = '%Y%m%dT%H:%M';
190 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]$/ ) {
191 0 $format = '%Y%m%d/%H:%M:%S';
192 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][-+]\d+$/ ) {
193 0 $format = '%Y-%m-%d %H%M%z';
194 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]Z$/ ) {
195 0 $format = '%Y-%m-%d %H%MZ';
196 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]\ .+$/ ) {
197 0 $format = '%Y-%m-%d %H%M %Z';
198 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
199 0 $format = '%Y-%m-%d %H%M%S%z';
200 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
201 0 $format = '%Y-%m-%d %H%M%SZ';
202 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]\ .+$/ ) {
203 0 $format = '%Y-%m-%d %H%M%S %Z';
204 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][-+]\d+$/ ) {
205 0 $format = '%Y-%m-%dT%H%M%z';
206 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]Z$/ ) {
207 0 $format = '%Y-%m-%dT%H%MZ';
208 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]\ .+$/ ) {
209 0 $format = '%Y-%m-%dT%H%M %Z';
210 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
211 0 $format = '%Y-%m-%dT%H%M%S%z';
212 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
213 0 $format = '%Y-%m-%dT%H%M%SZ';
214 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]\ .+$/ ) {
215 0 $format = '%Y-%m-%dT%H%M%S %Z';
216 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9][-+]\d+$/ ) {
217 0 $format = '%Y-%m-%dT%H%M%z';
218 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9]Z$/ ) {
219 0 $format = '%Y-%m-%dT%H%MZ';
220 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9]\ .+$/ ) {
221 0 $format = '%Y-%m-%dT%H%M %Z';
222 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
223 0 $format = '%Y-%m-%d/%H%M%S%z';
224 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
225 0 $format = '%Y-%m-%d/%H%M%SZ';
226 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][-+]\d+$/ ) {
227 0 $format = '%Y%m%d %H%M%z';
228 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9]Z$/ ) {
229 0 $format = '%Y%m%d %H%M%Z';
230 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
231 0 $format = '%Y%m%d %H%M%S%z';
232 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
233 0 $format = '%Y%m%d %H%M%SZ';
234 } elsif ( $string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][-+]\d+$/ ) {
235 0 $format = '%Y%m%dT%H%M%z';
236 } elsif ( $string =~ /\^d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9]Z$/ ) {
237 0 $format = '%Y%m%dT%H%MZ';
238 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
239 0 $format = '%Y%m%dT%H%M%S%z';
240 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
241 0 $format = '%Y%m%dT%H%M%SZ';
242 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9][-+]\d+$/ ) {
243 0 $format = '%Y%m%dT%H%M%z';
244 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9]Z$/ ) {
245 0 $format = '%Y%m%dT%H%MZ';
246 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9][-+]\d+$/ ) {
247 0 $format = '%Y%m%d/%H%M%S%z';
248 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9]Z$/ ) {
249 0 $format = '%Y%m%d/%H%M%SZ';
250 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9]$/ ) {
251 0 $format = '%Y-%m-%d %H%M';
252 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
253 0 $format = '%Y-%m-%d %H%M%S';
254 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9]$/ ) {
255 0 $format = '%Y-%m-%dT%H%M';
256 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
257 0 $format = '%Y-%m-%dT%H%M%S';
258 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9]$/ ) {
259 0 $format = '%Y-%m-%dT%H%M';
260 } elsif ( $string =~ /^\d\d\d\d\-\d\d-\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
261 0 $format = '%Y-%m-%d/%H%M%S';
262 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9]$/ ) {
263 0 $format = '%Y%m%d %H%M';
264 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\ [0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
265 0 $format = '%Y%m%d %H%M%S';
266 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9]$/ ) {
267 0 $format = '%Y%m%dT%H%M';
268 } elsif ( $string =~ /^\d\d\d\d\d\d\d\dT[0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
269 0 $format = '%Y%m%dT%H%M%S';
270 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9]$/ ) {
271 0 $format = '%Y%m%dT%H%M';
272 } elsif ( $string =~ /^\d\d\d\d\d\d\d\d\/[0-2][0-9][0-5][0-9][0-5][0-9]$/ ) {
273 0 $format = '%Y%m%d/%H%M%S';
274  
275 }
276  
277 3 return $format, $regex;
278 } ## end sub guess
279  
280 =head2 guess_to_object
281  
282 Takes the string, calles guess on it. If it gets a hit, it then returns
283 the Time::Piece object.
284  
285 Optionally there is the option to enable specials as well. See the section
286 on specials further down.
287  
288 If it fails, undef is returned.
289  
290 $tp_object = Time::Piece::Guess->guess_to_object('2023-02-27T11:00:18');
291 if (!defined( $tp_object )){
292 print "No matching format found\n";
293 }
294  
295 The same thing, but enabling specials and, resulting in it appending the local timezone
296 offset data that would correspond to %z.
297  
298 $tp_object = Time::Piece::Guess->guess_to_object('2023-02-27T11:00:18zz', 1);
299  
300 =cut
301  
302 1 ▶sub guess_to_object {
Subroutine guess_to_object: called CC=22 SCAR=52.7
Pod documented
303 1 my $string = $_[1];
304 1 my $special = $_[2];
305  
306 1 ▶ if ( !defined($string) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $string) 0 1 1
307 0 return undef;
308 }
309  
310 # if special is enabled and it looks like a now special
311 # return the current time with the diffence applied
312 1 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ($special and $string =~ /^now$/ || $string =~ /^now[\-\+]\d+[mhdw]?$/ || $string =~ /^[\-\+]\d+[mhdw]?$/) 0 1 1
Condition11%1/9
$special and $string =~ /^now$/ || $string =~ /^now[\-\+]\d+[mhdw]?$/ || $string =~ /^[\-\+]\d+[mhdw]?$/
!ll&&!rl&&r
100
$string =~ /^now$/ or $string =~ /^now[\-\+]\d+[mhdw]?$/ or $string =~ /^[\-\+]\d+[mhdw]?$/
l!l&&r!l&&!r
000
$string =~ /^now$/ or $string =~ /^now[\-\+]\d+[mhdw]?$/
l!l&&r!l&&!r
000
MC/DC0%0/4
$special and $string =~ /^now$/ || $string =~ /^now[\-\+]\d+[mhdw]?$/ || $string =~ /^[\-\+]\d+[mhdw]?$/
$special $string =~ /^now$/ $string =~ /^now[\-\+]\d+[mhdw]?$/ $string =~ /^[\-\+]\d+[mhdw]?$/
Truth table20%1/5
A and B or C or D
A= $specialB= $string =~ /^now$/C= $string =~ /^now[\-\+]\d+[mhdw]?$/D= $string =~ /^[\-\+]\d+[mhdw]?$/
ABCDresult
0XXX0
10000
11XX1
101X1
10011
313 $special
314 && ( $string =~ /^now$/
315 || $string =~ /^now[\-\+]\d+[mhdw]?$/
316 || $string =~ /^[\-\+]\d+[mhdw]?$/ )
317 )
318 {
319 0 my $t = localtime;
320  
321 # if just now, it is asking for the current time, so just return that
322 0 ▶ if ( $string eq 'now' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($string eq "now") 0 0 0
323 0 return $t;
324 }
325  
326 # since this is more than just now, remove the now part and proceed to
327 # figure out what the off set is
328 0 $string =~ s/^now//;
329  
330 # figure out what to multiply the offset by
331 # nothing, seconds
332 0 my $multiplier = 1;
333 0 ▶ if ( $string =~ /m$/ ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($string =~ /m$/) { } 0 0 0
elsif ($string =~ /h$/) { } 0 0 0
elsif ($string =~ /d$/) { } 0 0 0
elsif ($string =~ /w$/) { } 0 0 0
334 # minutes
335 0 $multiplier = 60;
336 0 $string =~ s/m$//;
337 } elsif ( $string =~ /h$/ ) {
338 # hours
339 0 $multiplier = 60 * 60;
340 0 $string =~ s/h$//;
341 } elsif ( $string =~ /d$/ ) {
342 # days
343 0 $multiplier = 60 * 60 * 24;
344 0 $string =~ s/d$//;
345 } elsif ( $string =~ /w$/ ) {
346 # weeks
347 0 $multiplier = 60 * 60 * 24 * 7;
348 0 $string =~ s/w$//;
349 }
350  
351 # figure out the direction we are going
352 # multiply it
353 # apply the offset
354 0 ▶ if ( $string =~ /^\-/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($string =~ /^\-/) { } 0 0 0
355 0 $string =~ s/^\-//;
356 0 $string = $string * $multiplier;
357 0 $t = $t - $string;
358 } else {
359 0 $string =~ s/^\+//;
360 0 $string = $string * $multiplier;
361 0 $t = $t + $string;
362 }
363  
364 0 return $t;
365 } ## end if ( $special && ( $string =~ /^now$/ || $string...))
366  
367 # if special is enabled and ZZ or zz is used at the end
368 # append the timezone abbreviation
369 1 my $make_local = 0;
370 1 ▶ if ( $special
Branch: 2 branches
BranchTrueFalseTotal
if ($special and $string =~ /zz$/) { } 0 1 1
elsif ($special and $string =~ /ZZ$/) { } 0 2 2
Condition33%1/3
$special and $string =~ /zz$/
!ll&&!rl&&r
100
MC/DC0%0/2
$special and $string =~ /zz$/
$special $string =~ /zz$/
Truth table33%1/3
A and B
A= $specialB= $string =~ /zz$/
ABresult
0X0
100
111
371 && $string =~ /zz$/ )
372 {
373 0 my $t = localtime;
374 0 my $zone = $t->strftime("%z");
375 0 $string =~ s/zz$/$zone/;
376 0 $make_local = 1;
377 ▶ } elsif ( $special
Condition33%1/3
$special and $string =~ /ZZ$/
!ll&&!rl&&r
100
MC/DC0%0/2
$special and $string =~ /ZZ$/
$special $string =~ /ZZ$/
Truth table33%1/3
A and B
A= $specialB= $string =~ /ZZ$/
ABresult
0X0
100
111
378 && $string =~ /ZZ$/ )
379 {
380 0 my $t = localtime;
381 0 my $zone = $t->strftime("%Z");
382 0 $string =~ s/\ ?ZZ$/\ $zone/;
383 0 $make_local = 1;
384 }
385  
386 1 my ( $format, $ms_clean_regex ) = Time::Piece::Guess->guess($string);
387  
388 1 ▶ if ( !defined($format) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $format) 0 1 1
389 0 return undef;
390 }
391  
392 1 ▶ if ( defined($ms_clean_regex) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ms_clean_regex) 0 1 1
393 0 $string =~ s/$ms_clean_regex//;
394 }
395  
396 # append 00 for minutes if %z is on the end
397 # as Time::Piece does not handle it properly if it
398 # is just hours
399 1 ▶ if ($format =~ /\%z/ && $string =~ /[-+]\d\d$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($format =~ /\%z/ and $string =~ /[-+]\d\d$/) 0 1 1
Condition33%1/3
$format =~ /\%z/ and $string =~ /[-+]\d\d$/
!ll&&!rl&&r
010
MC/DC0%0/2
$format =~ /\%z/ and $string =~ /[-+]\d\d$/
$format =~ /\%z/ $string =~ /[-+]\d\d$/
Truth table33%1/3
A and B
A= $format =~ /\%z/B= $string =~ /[-+]\d\d$/
ABresult
0X0
100
111
400 0 $string=$string.'00';
401 }
402  
403 1 my $t;
404 1 eval { $t = Time::Piece->strptime( $string, $format ); };
405 1 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 1 1
406 0 return undef;
407 }
408  
409 # unfortunately Time::Piece lakes the ability to set this currently
410 1 ▶ if ($make_local) {
Branch: 1 branch
BranchTrueFalseTotal
if ($make_local) 0 1 1
411 0 $t->[10] = 1;
412 }
413  
414 1 return $t;
415 } ## end sub guess_to_object
416  
417 =head1 SPECIAL FORMATS
418  
419 =head2 now
420  
421 Now is returns current time.
422  
423 =head2 now[-+]\d+[mhdw]?
424  
425 Returns the current time after adding or subtracting the specified number of seconds.
426  
427 The following may be applied to the end to act as a multipler.
428  
429 - m :: The specified number is minutes.
430  
431 - h :: The specified number is hours.
432  
433 - d :: The specified number is hours.
434  
435 - w :: The specified number is weeks.
436  
437 So 'now-5' would be now minus five seconds and 'now-5m' would be now minus five minutes.
438  
439 =head2 zz
440  
441 Apply the current time zone to the end prior to parsing. Offset is determined by %z.
442  
443 '2023-07-23T17:34:00zz' if in -0500 would become '2023-07-23T17:34:00-0500'.
444  
445 =head2 ZZ
446  
447 Apply the current time zone name to the end prior to parsing. The name is determined
448 by %Z.
449  
450 =head1 AUTHOR
451  
452 Zane C. Bowers-Hadley, C<< <vvelox at vvelox.net> >>
453  
454 =head1 BUGS
455  
456 Please report any bugs or feature requests to C<bug-time-piece-guess at rt.cpan.org>, or through
457 the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Time-Piece-Guess>. I will be notified, and then you'll
458 automatically be notified of progress on your bug as I make changes.
459  
460  
461  
462  
463 =head1 SUPPORT
464  
465 You can find documentation for this module with the perldoc command.
466  
467 perldoc Time::Piece::Guess
468  
469  
470 You can also look for information at:
471  
472 =over 4
473  
474 =item * RT: CPAN's request tracker (report bugs here)
475  
476 L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Time-Piece-Guess>
477  
478 =item * CPAN Ratings
479  
480 L<https://cpanratings.perl.org/d/Time-Piece-Guess>
481  
482 =item * Search CPAN
483  
484 L<https://metacpan.org/release/Time-Piece-Guess>
485  
486 =back
487  
488  
489 =head1 ACKNOWLEDGEMENTS
490  
491  
492 =head1 LICENSE AND COPYRIGHT
493  
494 This software is Copyright (c) 2023 by Zane C. Bowers-Hadley.
495  
496 This is free software, licensed under:
497  
498 The Artistic License 2.0 (GPL Compatible)
499  
500  
501 =cut
502  
503 2 1; # End of Time::Piece::Guess
↑ Summary