Hi Stiga
Yes, all days you are in Denmark counts. Even if you are going back to Denmark, and lands 2 minutes to midnight (2358 local) it counts as a whole day in these 6 weeks within 182 days. Best is to stay away from Denmark as much as possible as long you are on ligningslovens §33a.