Delphi Basics Home  |  Delphi Basics .NET Home  |  System.DateTime  |  ToShortTimeString Method
ToShortTimeString  
Method  
Converts the current DateTime to a short time format string
DateTime Structure
System NameSpace
CF1.  Function ToShortTimeString : String;
CF : Methods with this mark are Compact Framework Compatible
Description
The ToShortTimeString returns a string representation of the current DateTime value. The format is the short time format, with no date values.
 
It is equivalent to ToString('t');
Microsoft MSDN Links
System
System.DateTime
System.DateTime.ToShortTimeString
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  when : DateTime;

begin
  // 11:12:13 on 20th June 2004
  when := DateTime.Create(2004, 6, 20, 11, 12, 13);

  Console.WriteLine(when.ToShortTimeString);

  Console.ReadLine;
end.
   11:12
 
© CodeGear 2006 - 2007. All rights reserved.