Home  |  Delphi .net Home  |  System.TimeSpan  |  Parse Method
  
Parse  
Method  
Converts a string representation of time span into a TimeSpan value
TimeSpan Structure
System NameSpace
CF1.  Function Parse ( Value : String ) : TimeSpan; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Parses the Value string representation of a time span into a TimeSpan value.
 
The syntax of the Value string is as follows :
 
[blanks][-][days.]hours:mins:secs[.frac][blanks]
 
The square brackets indicate optional values.
 
days Up to 10,675,199
hours 0 to 23
mins 0 to 59
secs 0 to 59
frac 1 to 7 decimal places
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
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
  span : TimeSpan;

begin
  span := System.TimeSpan.Parse('8:30:0');
  Console.WriteLine('span = {0}', span);

  span := System.TimeSpan.Parse('-123.17:45:20.123456');
  Console.WriteLine('span = {0}', span);

  Console.ReadLine;
end.
   span = 08:30:00
   span = -123.17:45:20.1234560
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author