Home  |  Delphi .net Home  |  System.TimeSpan  |  Add Method
  
Add  
Method  
Adds a timespan to the current timespan
TimeSpan Structure
System NameSpace
CF1.  Function Add ( Value : TimeSpan ) : TimeSpan;
CF : Methods with this mark are Compact Framework Compatible
Description
Adds the Value TimeSpan to the current TimeSpan.
Notes
An exception is thrown if the size of the TimeSpan exceeds Int64.MinValue or Int64.MaxValue (-9,223,372,036,854,775,808 and 9,223,372,036,854,775,807).
Microsoft MSDN Links
System
System.TimeSpan
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  span1, span2, span3 : TimeSpan;

begin
  span1 := TimeSpan.Create(7, 30, 0);      // 0 days, 7 hours, 30 minutes
  span2 := TimeSpan.Create(2, 3, 4, 0);    // 2 days, 3 hours,  4 minutes

  Console.WriteLine('Span1 = {0}', span1);
  Console.WriteLine('Span2 = {0}', span2);

  span3 := span1.Add(span2);

  Console.WriteLine('Span3 = {0}', span3);

  Console.ReadLine;
end.
   Span1 = 07:30:00
   Span2 = 2.03:04:00
   Span3 = 2.10:34:00
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author