I believe the actual science (rather than than that it's somehow sensitive to the time of day) is that it requires sunlight (UV) exposure to absorb, rather than just be excreted.
So if you work a nightshift, hopefully there's some opportunity still to get some sunlight either side, and you should take it before that.
(IANA healthcare professional)