"I dream for 2 miles at night, and miss my family at 12 o'clock a day" means: I dream for one night and return to my hometown 2 miles away; I miss my relatives all day, and I miss them for twelve hours.
five shifts: here refers to five shifts, from one shift to five shifts, that is, all night. I miss my loved ones during the day and dream of returning home at night, and my thoughts are always around my loved ones. These two sentences are written about homesickness day and night.
from: Song and Huang Tingjian's "Thinking of Family and Dressing up the State"