fixed database function can_cancel to take into account the timezone