View | Details | Raw Unified | Return to bug 21105
Collapse All | Expand All

(-)a/Koha/OAI/Server/Identify.pm (-6 / +7 lines)
Lines 20-27 Link Here
20
package Koha::OAI::Server::Identify;
20
package Koha::OAI::Server::Identify;
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
23
use HTTP::OAI;
24
use HTTP::OAI;
24
use C4::Context;
25
use C4::Context;
26
use Koha::DateUtils qw(dt_from_string);
25
27
26
use base ("HTTP::OAI::Identify");
28
use base ("HTTP::OAI::Identify");
27
29
Lines 59-70 sub _get_earliest_datestamp { Link Here
59
    my $dbh = C4::Context->dbh;
61
    my $dbh = C4::Context->dbh;
60
    # We do not need to perform timezone conversion here, because the time zone
62
    # We do not need to perform timezone conversion here, because the time zone
61
    # is set to UTC for the entire SQL session in Koha/OAI/Server/Repository.pm
63
    # is set to UTC for the entire SQL session in Koha/OAI/Server/Repository.pm
62
    my $query = q{
64
    my ( $earliest ) = $dbh->selectrow_array(q{
63
        SELECT DATE_FORMAT(MIN(timestamp), '%Y-%m-%dT%H:%i:%SZ') AS earliest
65
        SELECT MIN(timestamp) AS earliest
64
        FROM biblio
66
        FROM biblio
65
    };
67
    });
66
    my ( $earliest ) = $dbh->selectrow_array($query);
68
67
    return $earliest
69
    return dt_from_string( $earliest, 'sql' )->strftime('%FT%TZ');
68
}
70
}
69
71
70
1;
72
1;
71
- 

Return to bug 21105