You are not logged in.
Hi Ab i need this 2 Functions for iOS and Android. I just modified SynCrossPlatformSpecific.pas.
{$ifdef ISDWS}
{$if defined(IOS) or defined(ANDROID)}
function DateTimeToIso8601(Value: TDateTime): string;
function Iso8601ToDateTime(const Value: string): TDateTime;
{$ifend}
{$if defined(ISDWS)}
procedure DoubleQuoteStr(var text: string);
function IdemPropName(const PropName1,PropName2: string): boolean;
function StartWithPropName(const PropName1,PropName2: string): boolean;
@@ -330,14 +337,10 @@ procedure DecodeDate(Value: TDateTime; var Y,M,D: word);
function TryEncodeDate(Y,M,D: integer; var Value: TDateTime): boolean;
function TryEncodeTime(HH,MM,SS,MS: integer; var Value: TDateTIme): boolean;
function NowToIso8601: string;
function DateTimeToIso8601(Value: TDateTime): string;
function Iso8601ToDateTime(const Value: string): TDateTime;
function TryStrToInt(const S: string; var Value: integer): Boolean;
function TryStrToInt64(const S: string; var Value: Int64): Boolean;
function StrToInt64Def(const S: string; const def: Int64): Int64;
function UpCase(ch: Char): Char; inline;
function GetNextCSV(const str: string; var index: Integer; var res: string;
Sep: char): boolean;
type
/// which kind of document the TJSONVariantData contains
@@ -371,7 +374,7 @@ function ValueToJSON(Value: variant): string; external 'JSON.stringify';
// - match function signature as defined in SynCrossPlatformJSON
function JSONToValue(JSON: string): variant; external 'JSON.parse';
{$endif}
{$ifend}
...
try
@@ -812,7 +820,9 @@ function NowToIso8601: string;
begin
result := DateTimeToIso8601(Now);
end;
{$ifend}
{$if defined(ISDWS) or defined(IOS) or defined(ANDROID)}
function DateTimeToIso8601(Value: TDateTime): string;
begin // e.g. YYYY-MM-DD Thh:mm:ss or YYYY-MM-DDThh:mm:ss
if Value<=0 then
@@ -858,8 +868,9 @@ begin // YYYY-MM-DD Thh:mm:ss or YYYY-MM-DDThh:mm:ss
end;
end;
end;
{$ifend} // itSDS
{$if defined(ISDWS)}
{ TJSONVariantData }
{$HINTS OFF}
@@ -955,7 +966,7 @@ begin
result := TSMSHttpConnectionClass;
end;
{$endif ISDWS}
{$ifend ISDWS}
Rad Studio 12.1 Santorini
Offline
Hi Arnoud,
Happy New Year
seem's that i made an error by copy and Paste!
I moved the 2 needed functions aut of ISDWS and added
{$if defined(ISDWS) or defined(IOS) or defined(ANDROID)}
around it to have it on all 3 Platforms and not to modify too much of your code.
The reason: i want to use the ISO8601 Format to save "Registry" - DateTime Values on all Platforms.
Rad Studio 12.1 Santorini
Offline