I need to create a variable with the current date/time in the following format: yyyy/mm/dd_HHMMSS
Is this possible? For the "$TIME$" variable, I did not see military time as an option.
Formatting Date and Time
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Formatting Date and Time
Dear User,
you could do it via script using Parse String command in order to have your desired format.
I suggest to you to have a look at the following forum topic.
it does not demonstrate you specific request, but can be used as a very useful starting point.
http://www.installaware.com/forum/viewt ... f=4&t=3167
Regards
you could do it via script using Parse String command in order to have your desired format.
I suggest to you to have a look at the following forum topic.
it does not demonstrate you specific request, but can be used as a very useful starting point.
http://www.installaware.com/forum/viewt ... f=4&t=3167
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Formatting Date and Time
Thanks for the sample. However, the month and day are single digits and I always need them to be double digits ex 2012-07-06 instead of 2012-7-6. Is there anyway to check for the length of the month or day and then append a 0 to the front if the length is just 1?
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Formatting Date and Time
Dear User,
the first possible thing that comes to my mind is to use a call to "lstrlen" WIN API function.
It returns the number of characters in a string.
To call it use "Call DLL function" command as the following example:
Then have a look also at the following topic for an alternative solution using IA script command:
http://www.installaware.com/forum/viewt ... ?f=2&t=609
Hope this helps you.
Regards
the first possible thing that comes to my mind is to use a call to "lstrlen" WIN API function.
It returns the number of characters in a string.
To call it use "Call DLL function" command as the following example:
Code: Select all
~InstallAware Clipboard Data~
~Call DLL Function~
~{5BAE1FEF-7F2C-46CE-B9AF-D5675673749C}~
~Kernel32.dll,lstrlenA,long,,"pointer to string",MYVARIABLE,$~
~mIDEFunc.dll\mEXEFunc.dll~
Code: Select all
Call DLL Function Kernel32.dll->lstrlenA
http://www.installaware.com/forum/viewt ... ?f=2&t=609
Hope this helps you.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

