using System;
using System.Globalization;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Build.Tasks
{
///
/// Returns a date stamp in the form yyMMdd.
///
public class DateStamp : Task
{
string date;
///
/// Gets a represting the date stamp.
///
[Output]
public string Date
{
get { return date; }
private set { date = value; }
}
public override bool Execute()
{
try
{
Date = DateTime.Now.ToString("yyMMdd", CultureInfo.InvariantCulture);
}
catch (Exception e)
{
Log.LogErrorFromException(e);
return false;
}
return true;
}
}
}