]> iEval git - webservice-strike.git/commitdiff
Fix usage of Date::Parse
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Mar 2015 13:43:46 +0000 (15:43 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Mar 2015 13:43:46 +0000 (15:43 +0200)
lib/WebService/Strike/Torrent.pm
t/WebService-Strike-Torrent.t
t/WebService-Strike.t

index 34502bd4ee1a0af843a608f96c7e66d79cefbd50..391a3cb94543167dd4e34bcadc9b186d1029be4f 100644 (file)
@@ -29,7 +29,7 @@ sub new{
        my ($self, @args) = @_;
        $self = $self->SUPER::new(@args);
        $self->{torrent_hash} = uc $self->hash;
-       $self->{upload_date} = str2time $self->date;
+       $self->{upload_date} = str2time $self->date, 'UTC';
        $self->{file_names} = $self->file_info->[0]->{file_names};
        $self->{file_lengths} = $self->file_info->[0]->{file_lengths};
        $self
@@ -79,7 +79,7 @@ WebService::Strike::Torrent - Class representing information about a torrent
   say $t->leeches;
   say $t->count;            # 1
   say $t->size;             # 587 MB
-  say $t->date;             # 1420495200
+  say $t->date;             # 1420502400
   say $t->uploader;         # The_Doctor-
   say @{$t->names};         # archlinux-2015.01.01-dual.iso
   say @{$t->lengths};       # 615514112
index 9787119a3bfb1e66d803c3d73c875613b0c70973..ce57b0b347164db04c1c2fccdf07bc043ae6a85d 100644 (file)
@@ -32,7 +32,7 @@ is $t->seeds, 645, 'seeds';
 is $t->leeches, 13, 'leeches';
 is $t->count, 1, 'count';
 is $t->size, '587 MB', 'size';
-is $t->date, 1420495200,'date';
+is $t->date, 1420502400,'date';
 is $t->uploader, 'The_Doctor-', 'uploader';
 is $t->names->[0], 'archlinux-2015.01.01-dual.iso', 'names';
 is $t->lengths->[0], 615514112, 'lengths';
index ffd59ad64464f676f3bd97abb28864ee6d364023..ce3c39e20a4f947bf3e29d845504b01b0e1a8305 100644 (file)
@@ -16,7 +16,7 @@ subtest 'order' => sub {
        is $t3->hash, '85DF191A921C20B2DDAFF72368CAB93BA18C5ACE', 'hash #3'
 };
 
-is $t1->date, 1420495200, 'date';
+is $t1->date, 1420502400, 'date';
 is $t2->title, 'FreeBSD 7.1 i386.DVD.iso', 'title';
 like $t1->torrent, qr/^d/, 'torrent file starts with d';
 
This page took 0.03249 seconds and 4 git commands to generate.