Ron
2006-12-31 17:40:03
TheDate returns the date like this: December 31, 2006
Test function code:
~Ron
// TheDate will return the current date in this format: Month Day, Year
// Made by Ron :)
function TheDate : String;
var
Year, Month, Day : Word;
M, D : String;
begin
DecodeDate(Date, Year, Month, Day);
case Month of
1 : M := 'January';
2 : M := 'February';
3 : M := 'March';
4 : M := 'April';
5 : M := 'May';
6 : M := 'June';
7 : M := 'July';
8 : M := 'August';
9 : M := 'September';
10 : M := 'October';
11 : M := 'November';
12 : M := 'December';
end;
case Day of
1 : D := 'st';
2 : D := 'nd';
3 : D := 'rd';
end;
if(Day > 3)then
D := 'th';
Result := M+' '+IntToStr(Day)+D+', '+IntToStr(Year);
end;
Test function code:
program New;
// TheDate will return the current date in this format: Month Day, Year
// Made by Ron :)
function TheDate : String;
var
Year, Month, Day : Word;
M, D : String;
begin
DecodeDate(Date, Year, Month, Day);
case Month of
1 : M := 'January';
2 : M := 'February';
3 : M := 'March';
4 : M := 'April';
5 : M := 'May';
6 : M := 'June';
7 : M := 'July';
8 : M := 'August';
9 : M := 'September';
10 : M := 'October';
11 : M := 'November';
12 : M := 'December';
end;
case Day of
1 : D := 'st';
2 : D := 'nd';
3 : D := 'rd';
end;
if(Day > 3)then
D := 'th';
Result := M+' '+IntToStr(Day)+D+', '+IntToStr(Year);
end;
begin
ClearDebug;
WriteLn(TheDate);
end.
~Ron