Created
March 23, 2012 03:02
-
-
Save sayedihashimi/2166385 to your computer and use it in GitHub Desktop.
MSBuild how to get a good formatted date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
What I was looking for. Thanks
Thnaks
Unix timestamp:
$([MSBuild]::Subtract($([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.Ticks), 10000000)))), 62135596800))
$([MSBuild]::Subtract($([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.Ticks), 10000000)))), 62135596800))
tks.
Ohhhhh....
Nice!!!!!!!
Thanks...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks