How long can a baby sleep in a pack n play??

My son is 10 months, we’re going on a trip tomorrow and I was thinking about being bringing his pack n play for him to sleep in. Is this okay?