在我的 msbuild 脚本中,我在 zip 文件名中创建了一个带有年/月/日的 zip 文件,但月份和日期总是不带前导零。
有没有办法在我的 zip 文件名中添加前导零?
<Time>
<Output TaskParameter="Year" PropertyName="Year" />
<Output TaskParameter="Month" PropertyName="Month" />
<Output TaskParameter="Day" PropertyName="Day" />
</Time>
<PropertyGroup>
<ZipOutDir>C:\output</ZipOutDir>
<ZipFileName>Application_$(Year)$(Month)$(Day).zip</ZipFileName>
</PropertyGroup>
结果是:'Application_2010122.zip'(一月没有前导零,如您所见)