Change background color depending on the time of the day

Hello there,

I've noticed that the stock datafields have a dark background when this is the night.

It may be simple but how can I know when I need to set a black or a white background?

Thanks in advance