How i can change date and time format? I need replace ":" to "_" in time. Below my code:
<SetProperty Before='AppSearch' Sequence='both' Id='HOSTNAME' Value="[ComputerName]_[Time]_[Date]">NOT HOSTNAME</SetProperty>
How i can change date and time format? I need replace ":" to "_" in time. Below my code:
<SetProperty Before='AppSearch' Sequence='both' Id='HOSTNAME' Value="[ComputerName]_[Time]_[Date]">NOT HOSTNAME</SetProperty>
The MSI SDK documents this pretty well: Time Property:
The format of the value depends upon the user's locale, and is the format obtained using GetTimeFormat function with the TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER
option.
So the user's locale will affect the format, and then you probably need to use a custom action to get the formatting the way you want it. I can't think of any other way to do it.
All time silliest VBScript: (it is very late)
MsgBox Day(Now) & "_" & Month(Now) & "_" & Year(Now) & "_" & Hour(Now) & "_" & Minute(Now) & "_" & Second(Now)
And just a hint for how to insert custom actions can be found here: How to execute conditional custom action on install and modify only?