Home  |  Delphi .net Home  |  System.Globalization.Calendar  |  GetMilliSeconds Method
  
GetMilliSeconds  
Method  
Gets the specified DateTime MilliSeconds
Calendar Class
System.Globalization NameSpace
CF1.  Function GetMilliSeconds ( TheDateTime : DateTime ) : Integer;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns the MilliSeconds component of the specified TheDateTime value.
Notes
The time components of DateTime are culture invariant.
References
DateTime
CultureInfo
Microsoft MSDN Links
System.Globalization
System.Globalization.Calendar
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

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

uses
  System.Globalization;

var
  myDate    : DateTime;

  gbCulture : System.Globalization.CultureInfo;
  gbCal     : System.Globalization.Calendar;

begin
  // Set up a Great Britain English culture & calendar
  gbCulture := System.Globalization.CultureInfo.Create('en-GB');
  gbCal     := gbCulture.Calendar;

  // Create a DateTime object : use the gbCalendar to control the
  // conversion of year, month and day parameter values into the
  // number of ticks since 1st January 0001 AD (the internal value)

  // 10:30:13.123 on 8th December 2004
  myDate := DateTime.Create(2004, 12, 8, 10, 30, 15, 123, gbCal);

  // Now use the British calendar object to display this date
  Console.WriteLine('Hour   = {0}', gbCal.GetHour(myDate).ToString);
  Console.WriteLine('Minute = {0}', gbCal.GetMinute(myDate).ToString);
  Console.WriteLine('Second = {0}', gbCal.GetSecond(myDate).ToString);
  Console.WriteLine('Millis = {0}', gbCal.GetMilliSeconds(myDate).ToString);

  Console.ReadLine;
end.
   Hour   = 10
   Minute = 30
   Second = 15
   Millis = 123
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author