|
|
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.IsLeapYear(i)
then Console.WriteLine('{0} is a leap year', i.ToString)
else Console.WriteLine('{0} is not a leap year', i.ToString);
Console.ReadLine;
end.
| Show full unit code | 2000 is a leap year
2001 is not a leap year
2002 is not a leap year
2003 is not a leap year
2004 is a leap year
|
|
|
|