date format in msbuild script? -
I am creating a zip file in my MS Word script which contains the year / month / day zip filename, but the month and day Not always written with any leading zeros.
Is there a way to add leading Zero in my zip file name?
& lt; Time & gt; & Lt; Output Task Parameters = "Year" Property Name = "Year" /> & Lt; Output Task parameter = "month" property name = "month" /> & Lt; Output Task Parameter = "Day" Property Name = "Day" /> & Lt; / Time & gt; & Lt; PropertyGroup & gt; & Lt; ZipOutDir & gt; C: \ Production & lt; / ZipOutDir & gt; & Lt; ZipFileName & gt; Application _ $ (year) $ (month) $ (day) .zip & lt; / ZipFileName & gt; & Lt; / PropertyGroup & gt;
And the result is: 'application_2010122.zip' (with no leading zeros for January, as you can see)
You can bring the MSBuild extension pack:
Or use format on format from community functions [Which you see while using)
Comments
Post a Comment