hello Saurabh,
try
this.date1 = Date.ParseFromString("20100215"); this.date2 = Date.ParseFromString("20100218"); this.result = this.date1.Delta(this.date2);
Result: Duration value P3D
then,
this.duration = Duration.ParseFromString("P1Y14D"); this.result = this.duration.ConvertToDays(); Result: Integer value 379
Regards,
Chandan