Hi @JulieSAppel ,
I believe this should work and do it for any time difference between the on/off states.
If(
Modulo( :LightOnDate, In Days( 1 ) ) > Modulo( :DateTime, In Days( 1 ) ) & Modulo( :DateTime, In Hours( 1 ) ) == Modulo( :DateTime, In Days( 1 ) ),"Light Phase",
:LightOnDate < :DateTime <= :LightOffDate, "Light Phase",
"Dark Phase"
)
Should be independent of whether or not the on/off times are 1 hr, 12 hs, or 6 hrs apart.
I'm not sure how your setup is recording the data, but if it's basically pulling a time stamp from equipment and has some way to record (even if just a Boolean) the state of the equipment, e.g. 0==off and 1==on, then you would only need two columns, one would be the actual day/time column and the other would be the Boolean state of the system and you can set the Value Labels to 0 == "Dark Phase" and 1 == "Light Phase", for example. If you can do it that way, then you wouldn't need to worry about issues of going over midnight or even how long each phase is. Even if there's a user interface button that one clicks to change phases, the program should be able to record the state of the button and feed it to an output table with the date/time data as well.
Hope this helps!,
DS