Skip to content

Instantly share code, notes, and snippets.

@madd0
Forked from sayedihashimi/msbuild-get-date.proj
Created June 7, 2018 10:19
Show Gist options
  • Save madd0/253cd79af93b8458e7fde493d3fe6b93 to your computer and use it in GitHub Desktop.
Save madd0/253cd79af93b8458e7fde493d3fe6b93 to your computer and use it in GitHub Desktop.
MSBuild how to get a good formatted date
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Demo" >
<Target Name="Demo">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-mmss))</CurrentDate>
</PropertyGroup>
<Message Text="CurrentDate: $(CurrentDate)"/>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment