MSBuild MSBuildCommunityTasks Task Time

I have a MSBuild project and I want the current date to be added to a zip file that I am creating.

I am using the MSBuildCommunityTasks.

<!-- Import the CommunityTasks Helpper -->
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

On the website I can see a task called time. I have not been able to find doc on how to use Time.


In msbuild 4 you can now


so I am using


those ticks around the format are backticks not '

<?xml version="1.0" encoding="utf-8"?>

<Project DefaultTargets="Deploy" xmlns="">

<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

  <!-- Include MSBuild tasks here -->

      <DefaultExclude Include="****" />           

 <Target Name="Deploy" >

    <Time Format="yyyy-MM-dd">
    <Output TaskParameter="FormattedTime" PropertyName="buildDate" />

    <Message Text="Deploying ...."></Message>   

    <Copy  SourceFiles="@(DeploymentFiles)" DestinationFolder="C:\CCNET\$(buildDate)\bin\" />



Maslow's answer is correct (I can't comment on it or I would); I would only add to it that you have to be careful when implicitly calling System.DateTime.Parse.

A parsed string value like $([System.DateTime]::Parse("1970-01-01T00:00:00.0000000Z") doesn't seem to end up with a Kind of DateTimeKind.Utc.

But you can use nested property functions to make it work; like this (to get the Unix timestamp):


Need Your Help

Smooth scroll without the use of jQuery

javascript html

I'm coding up a page where I only want to use raw JavaScript code for UI without any interference of plugins or frameworks.

WebClient.DownloadString() returns string with peculiar characters

c# .net character-encoding special-characters

I have an issue with some content that we are downloading from the web for a screen scraping tool that I am building.