I would create a
TimeStamp measure based on the information returned by your [measureDATDate], but you need to know exactly what format the day, month, and year returned by that measure in order to create
TimeStampFormat...
Are there preceding zeroes for the days or months?
Is the year 2 digit or a full 4 digit?
With that information, you could create a
TimeStamp value of the returned date for comparison to a
Time measure of today's date.
The code below will change the background to red if the difference is over 2 weeks.
You may need to modify the TimeStampFormat= to match the values returned by your AV date.
I substituted my own date if the measure returned '0' ; which it does since I do not have that software.
Code: Select all
[measureDATDate]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\McAfee\AVEngine
RegValue=AVDatDate
;Update every 10 minutes
UpdateDivider=600
;re-arrange date to british format of day month year
RegExpSubstitute=1
Substitute="(\w+)/(\w+)/(\w+)":"\3/\2/\1T00:00:00","0":"25/05/2018T00:00:00"
; 2 weeks in seconds = 1209600 seconds
[MeasureCurrentTime]
Measure=Time
[MeasureDATDateSeconds]
Measure=Time
TimeStamp=[&measureDATDate]
TimeStampFormat=%d/%m/%YT%H:%M:%S
IfCondition=(MeasureCurrentTime - MeasureDATDateSeconds >= 1209600)
IfTrueAction=[!SetVariable BackgroundColor "255,0,0,100"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetVariable BackgroundColor "255,255,255,100"][!UpdateMeter *][!Redraw]
; ###################################################################################
[meterLabelDATDate]
Meter=String
MeterStyle=styleLeftText
X=10
Y=100
W=275
H=14
Text=DAT Date
SolidColor=#BackgroundColor#
DynamicVariables=1
[meterValueDATDate]
Meter=String
MeterStyle=styleRightText
MeasureName=measureDATDate
X=R
Y=0r
W=275
H=14
Text=%1
SolidColor=#BackgroundColor#
DynamicVariables=1