|
|
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)
// 8th December 2004
myDate := DateTime.Create(2004, 12, 8, gbCal);
// Display the date
Console.WriteLine(myDate.ToLongDateString);
Console.WriteLine;
Console.WriteLine('Adding 17 Days : ');
Console.WriteLine;
// Add 17 days to the date
myDate := gbCal.AddDays(myDate, 17);
// Display the date
Console.WriteLine(myDate.ToLongDateString);
Console.ReadLine;
end.
| Show full unit code | 08 December 2004
Adding 17 Days :
25 December 2004
|
|
|
|