Hi,
I need to figure out the computer age in days / years (to help with lifecycle prediction, next year’s budget, etc.)
in the past I did this using the following evaluation, based on Registry:
(date (local time zone) of now - (month (first 2 of it as integer) & day_of_month (first 2 of last 5 of it) & year (last 2 of it as integer + 2000)) of (if (exist key "HKEY_LOCAL_MACHINE\HARDWARE\Description\System\" of native registry and exist value "SystemBiosDate" of key "HKEY_LOCAL_MACHINE\HARDWARE\Description\System\" of native registry) then value "SystemBiosDate" of key "HKEY_LOCAL_MACHINE\HARDWARE\Description\System\" of native registry as string else "") )
This would work fine, but when the queried system is using UEFI it does not create the registry key.
Good possible alternatives are either the “Bios” inspector:
q: bios
A: 04/17/2019
T: 0.711 ms
I: singular bios
or the SMBios object:
q: unique values whose(it != “”) of (it as string as trimmed string) of values “bios_release_date” of structures “bios_information” of smbios
A: 04/17/2019
T: 0.636 ms
I: plural string with multiplicity
both return valid information for both BIOS and UEFI machines, and are close enough to the actual purchase date to use, but they return as “Bios” type.
can I convert the Bios type to days?
I tried various “now - bios” queries, but couldn’t find one that actually worked.
any way to accomplish this?
Thanks!