Home  |  Delphi .net Home  |  System.Globalization.DateTimeFormatInfo  |  GetAbbreviatedEraName Method
  
GetAbbreviatedEraName  
Method  
Get the abbreviated Era name for the specified era number
DateTimeFormatInfo Class
System.Globalization NameSpace
CF1.  Function GetAbbreviatedEraName ( Era : Integer ) : String;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns the name of the Era for the given Era number.
 
For the Gergorian Calendar, used in Britain, there is only one era covered : A.D. since date handlin in .Net starts at 00:00:00 on 1st January 0001 AD.
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;
  britCal        : System.Globalization.Calendar;

  dateTimeFormat : System.Globalization.DateTimeFormatInfo;

  era            : Integer;
  eras           : Array of Integer;

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

  // Display the British Eras :
  eras           := britCal.Eras;
  dateTimeFormat := britCulture.DateTimeFormat;
  for era := 0 to Length(eras)-1 do
    Console.WriteLine('British Era {0} = {1}',
              eras[era].ToString,
              dateTimeFormat.GetAbbreviatedEraName(eras[era]));

  Console.ReadLine;
end.
   British Era 1 = AD
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author