|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
uses
System.Globalization;
var
gbCulture : System.Globalization.CultureInfo;
gbCal : System.Globalization.Calendar;
i : Integer;
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)
for i := 2000 to 2004 do
if gbCal.IsLeapMonth(i, 2)
then Console.WriteLine('February {0} is a leap month', i.ToString)
else Console.WriteLine('February {0} is not a leap month', i.ToString);
Console.ReadLine;
end.
| Show full unit code | At the time of writing, this method fails to operate correctly :
----------------------------------------------------------------
February 2000 is not a leap month
February 2001 is not a leap month
February 2002 is not a leap month
February 2003 is not a leap month
February 2004 is not a leap month
|
|
|
|