Date Time for Unique String

Create a unique string using current date and time.

Description: A string unique to the local host can be created out of the %date% and %time% system environment variables.
For convenience the unique string created here will be a number in the format YYYYMMDDHHMMSSff whereas ff are the 1/100th fractions of a second. As long nobody modifies the system time and the command is not being called twice within a 1/100th of a second, each created UNIQUE string will be unique and in a sorting order.
The example described here assumes that the %date% variable uses the format day MM/DD/YYYY and the %time% variable uses the format HH:MM:SS.ff.
As the %time% variable may return only one digit for the hour before 10.00 AM and put a spacer to fill the missing 10th digit we will substitute the space characters in %time% with 0 by using %time: =0%.
Script:
1.
2.
3.
4.
for /f "tokens=2-8 delims=/:. " %%A in ("%date%:%time: =0%") do set "UNIQUE=%%C%%A%%B%%D%%E%%F%%G"
echo.%UNIQUE%
echo.%date% %time%
echo.%date% %time: =0%
Script Output:
 DOS Script Output
2006010501060696
Thu 01/05/2006  1:06:06.96
Thu 01/05/2006 01:06:06.96