Hi,
I need to find the time of day so that in an IIF statement I can display some text based on the time of day and the light level.
Does anyone have some RTMC code that gives the time in a format that I can use for this? Basically I have a light sensor and if I know the time of day I can put up the cloud status, e.g. if it is mid-day and the light is below 1000 uE/M/S then it is cloudy...
Thanks!
Scott.
Have you looked at the Time Functions in RTMC? SystemTime will return the current computer time. Timestamp will return the timestamp for an associated record.
Dana
In order to evaluate the time of day, you will want to do something like the following (assuming a variable name of "value"):
IIF(FormatTime(Timestamp(value), $"%H%M") >= 700 OR FormatTime(Timestamp(value), $"%H%M") <= 1800), daylight_expr, night_expr)
The FormatTime function will produce a string that has only the hour and minute components.