I used to work night shift. It was tough as on my days off I’d switch my sleep to be up during the day then switch sleep back when the workweek started again. Go by the clock hours for fasting. Set yourself up for success. If on a day off and you switch sleep and plan to eat with friends, pick another day to fast. Maybe start with intermittent fast with a 4 hour eating window first.
It’s easier to fast during sleeping hours. I work nights 7p-7a and have fasted during those hours or during sleep and I prefer sleep.
Honestly any fasting is helpful and it shouldn’t always be the same hours anyways. Choose your fast, do it 4x a week doesn’t matter when.
I prefer to get most fasting hours done while sleeping personally