Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function StringToDateTime(DateStr: String): TDateTime;
- var
- FS: TFormatSettings;
- begin
- FS:= TFormatSettings.Create;
- FS.DateSeparator := '-';
- FS.DateSeparator := ':';
- FS.ShortDateFormat := 'dd-mm-yyyy';
- FS.ShortTimeFormat := 'hh:nn:ss';
- try
- Result := StrToDateTime(DateStr); //the format of the string is different
- // ios : m/d/y
- // android : dd/mm/yy
- except on E: Exception do
- ShowMessage(e.ToString);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement