I work days and nights 12 hour shifts 2 on 2 off so 2 days 2 off 2 nights 2 off etc. 7 till 7
What I do is sleep normally when I'm on days, then the night before starting nights stay up a bit later, maybe midnight or 1am, and aim to get up around midday. Then when finishing nights usually get to bed around 8am, so try and get up no later than 2 which gives me enough sleep to not feel like crap all day but I'll be tired enough to get to sleep at a normal time.
The staying up all night the night before trick can work but I find you just end up wasting another day sleeping