Delphi 12 update 1 DateTimeToStr is in the
C:\Program Files (x86)\Embarcadero\Studio\23.0\source\rtl\sys\System.SysUtils.pas
function DateTimeToStr(const DateTime: TDateTime): string; overload; inline;
function DateTimeToStr(const DateTime: TDateTime;
const AFormatSettings: TFormatSettings): string; overload; inline;
But the word “interface” is not in this System.SysUtils file where it should be
meaning the entire file is not accessible to the complier
At the same time their is many double standards to the one instruction that is totally frustrating.
This word inline; - what does it mean to the complier? overload?
Can I just get a file with the complete function please -
function DateTimeToStr(const DateTime: TDateTime;
const AFormatSettings: TFormatSettings): string;
Overload : Tells the compiler that there are multiple definitions of the method. Allows the method to be executed with multiple different parameter sets, so for the example, the function could be executed with parameter of TDateTime alone or (TDateTime and TFormatSettings).
Personally, I believe that overload is redundant, since It is sufficient for all methods with the same name to have different signatures (ordered set of parameter-types&return-type.) RSP-13778 issue closed on Nov 22, 2019 by Marco Cantù with comment:
This is a key language features (that has been copied by other programming languages), not going to change it
It’s a record - you should pre-populate it first to get the operating system defaults and then override them if you need to - BUT I suggest you use the FormatDateTime function instead based on what you’re trying to do.
I get it - I don’t understand why not uniform everything
rename FormatDateTime to DateTimeToStr
and remove FormatDateTime as a Delphi instruction so you have 1 rock sold instruction for the task!!!
To be RAD its about having a RAD layout to the Instruction set
At the same time their is so much good about Delphi as a language
may be I’m a perfectionist sorry
I have a TDateTimePicker on my form and when I set the TDateTimePicker and trace DTPicker.DateTime is my input not my output of what I just manually as a user set it at, why? where is the output from what the user set it at?
Date and time are original settings
procedure TForm1.DTPickerExit(Sender: TObject);
begin
If LBRec.LBData = lbDate then LBRec.Date := DTPicker.Date;
If LBRec.LBData = lbTime then LBRec.Time := DTPicker.Time;
If LBRec.LBData = lbDateTime then LBRec.DateTime := DTPicker.DateTime;
end;