i am looking an funtion to reverse any string (YYYYMDD
,YY/MM/DD
,YYMMDD
,...) created by the function FormatDateTime to datetime.
example
i have a string-date in format YYYYMMDD
created by FormatDateTime
mydatestr:=FormatDateTime('YYYYMMDD',Mydate);
now how i can convert mydatestr to DateTime
again?
UPDATE
these functions
function StrToDate(const S: string): TDateTime; overload;
function StrToDate(const S: string;
const FormatSettings: TFormatSettings): TDateTime; overload;
function StrToDateTime(const S: string): TDateTime; overload;
function StrToDateTime(const S: string;
const FormatSettings: TFormatSettings): TDateTime; overload;
does not support passing an string wich the format to convert.
i am looking somethign like this
Mydatetime:=InvFormatDatetime('20091225','yyyymmdd');
or
Mydatetime:=InvFormatDatetime('20090108','yyyyddmm');