We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Format DateDiff

When I use formulas:

DateDiff(\"d\",\"2016 10 20 00:00:00\",\"2015 10 22 00:00:00\", 1 , 1) don't evalue correctly.

return #ERROR

Is format right ??

Hi Jose,

Thank you for writing to Aspose Support team.

Could you please share if the same works fine with MSP at your end? Please share a sample project file with us that we can use for comparison of the same at our end. We’ll look into this for assisting you further.


It is a sample code in console app demo.

public class Program
static void Main(string[] args)
Project project = CreateTestProjectWithCustomField();
var task = project.RootTask.Children.GetById(1);

project.ExtendedAttributes[0].Formula = “DateAdd(“d”,21,“2016 01 04”)”;

project.ExtendedAttributes[0].Formula = “DateDiff(“d”,“2016 10 20 00:00:00”,“2015 10 22 00:00:00”)”;

project.ExtendedAttributes[0].Formula = “DatePart( “D”, “2015 03 19 00:00:00”,1 ,1)”;


static Project CreateTestProjectWithCustomField()
Project project = new Project();
ExtendedAttributeDefinition attr = new ExtendedAttributeDefinition();
attr.FieldId = ExtendedAttributeTask.Text1.ToString(“D”);
attr.Alias = “demo”;

var task = project.RootTask.Children.Add(“Task”);

ExtendedAttribute a = attr.CreateExtendedAttribute();
return project;

When I use the functions
  1. ProjDateAdd( date, duration, calendar )
  2. ProjDateConv( expression, dateformat )
  3. ProjDateDiff( date1, date2, calendar )
  4. ProjDateSub( date, duration, calendar )
I obtain rigth result but with the sample code It return #ERROR as result.


Hi Jose,

Thank you for providing more details.

This issue is re-produced and logged under Id: TASKSNET-1684 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

The issues you have found earlier (filed as TASKSNET-1684) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.