Skip to content

Commit

Permalink
remove support for negative epoch values from Mojo::Date again
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 4, 2017
1 parent c09b0f1 commit d87581f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Date.pm
Expand Up @@ -22,7 +22,7 @@ sub parse {
my ($self, $date) = @_;

# epoch (784111777)
return $self->epoch($date) if $date =~ /^-?\d+$|^-?\d+\.\d+$/;
return $self->epoch($date) if $date =~ /^\d+$|^\d+\.\d+$/;

# RFC 822/1123 (Sun, 06 Nov 1994 08:49:37 GMT)
# RFC 850/1036 (Sunday, 06-Nov-94 08:49:37 GMT)
Expand Down
4 changes: 0 additions & 4 deletions t/mojo/date.t
Expand Up @@ -79,10 +79,6 @@ $date = Mojo::Date->new(1305280824);
is $date->to_string, 'Fri, 13 May 2011 10:00:24 GMT', 'right format';
$date = Mojo::Date->new('1305280824.23');
is $date->to_string, 'Fri, 13 May 2011 10:00:24 GMT', 'right format';
$date = Mojo::Date->new(-127180500);
is $date->to_string, 'Tue, 21 Dec 1965 00:05:00 GMT', 'right format';
$date = Mojo::Date->new('-127180500.23');
is $date->to_string, 'Tue, 21 Dec 1965 00:04:59 GMT', 'right format';

# Current time roundtrips
my $before = time;
Expand Down

0 comments on commit d87581f

Please sign in to comment.