Home  |  Delphi .net Home  |  System.TimeSpan  |  Negate Method
Negate  
Method  
Negates the current TimeSpan value
TimeSpan Structure
System NameSpace
CF1.  Function Negate ( ) : TimeSpan;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns a new TimeSpan with the current TimeSpane value negated.
Microsoft MSDN Links
System
System.TimeSpan
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  span1, span2 : TimeSpan;

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

  span2 := span1.Negate;

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

  Console.ReadLine;
end.
Show full unit code
  Span1 = 2.03:04:00
  Span2 = -2.03:04:00
 
 
Delphi Programming © Neil Moffatt All rights reserved.  |  Contact the author