Skip to content

Commit edd7c23

Browse files
committed
updated
1 parent 69aed0c commit edd7c23

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/Net/RDAP/Event.pm

+8-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ L<DateTime>, use C<$event-E<gt>date-E<gt>DateTime>.
6464
6565
=cut
6666

67-
sub date { DateTime::Tiny->from_string(substr(shift->{'eventDate'}, 0, 19)) }
67+
sub date { DateTime::Tiny->from_string(substr(shift->{eventDate}, 0, 19)) }
6868

6969
=pod
7070
@@ -73,12 +73,16 @@ sub date { DateTime::Tiny->from_string(substr(shift->{'eventDate'}, 0, 19)) }
7373
$tz = $event->date_timezone;
7474
7575
Since L<DateTime::Tiny> does not support time zones, this method will return the
76-
time zone part of the C<eventDate> property. This will be a UTC offset, mnemonic
77-
name, etc.
76+
time zone part of the C<eventDate> property. For a well-formed C<eventDate>
77+
value, this will either be C<Z> (indicating UTC, or an offset of the form
78+
C<+/-HH:MM>.
7879
7980
=cut
8081

81-
sub date_timezone { substr(shift->{'eventDate'}, 20) }
82+
sub date_timezone {
83+
my $str = substr(shift->{eventDate}, 20);
84+
$str =~ s/^\.\d+//g;
85+
}
8286

8387
=pod
8488

0 commit comments

Comments
 (0)