my $tasks_to_do = $self->search(
{
-and => [ scheduled_run_time => { '<=', 'NOW()'}, status => 'pending' ]
}
);
####
BEGIN {
$ENV{TZ} = 'Australia/Sydney';
}
##
##
$schema->storage->dbh_do(sub {"SET TIMEZONE='Australia/Sydney'"} );
##
##
sessions=> SET TIMEZONE='UTC';
SET
sessions=> select * from mytable where scheduled_run_time <= NOW() and status = 'pending';
##
##
sessions=> SET TIMEZONE='Australia/Sydney';
SET
sessions=> select * from mytable where scheduled_run_time <= NOW() and status = 'pending';