Home  |  Delphi .net Home  |  System.Globalization.DateTimeFormatInfo  |  GetEra Method
  
GetEra  
Method  
Get the Era number for the given Era name
DateTimeFormatInfo Class
System.Globalization NameSpace
CF1.  Function GetEra ( EraName : String ) : Integer;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns the Era Number for the given EraName.
 
For the Gregorian Calendar, .Net only supports dates from 1st January 0001 AD, and hence only one era : 'A.D.'
Microsoft MSDN Links
System.Globalization
System.Globalization.DateTimeFormatInfo
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

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

uses
  System.Globalization;

var
  britCulture    : System.Globalization.CultureInfo;

  dateTimeFormat : System.Globalization.DateTimeFormatInfo;

begin
  // Set up British culture
  britCulture := CultureInfo.Create('en-GB');

  // Display the Era number for 'A.D.'
  dateTimeFormat := britCulture.DateTimeFormat;

  Console.WriteLine('A.D. is era number {0}',
                    dateTimeFormat.GetEra('A.D.').ToString);

  Console.ReadLine;
end.
   A.D. is era number 1
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author