+ try
+ Result := StrToDateTime( inDateTimeString );
+ except
+ if( inDateTimeString[5] = '/' ) and ( inDateTimeString[8] = '/' ) then begin
+ y := StrToIntDef( Copy(inDateTimeString, 1, 4), 1970 );
+ m := StrToIntDef( Copy(inDateTimeString, 6, 2), 1 );
+ d := StrToIntDef( Copy(inDateTimeString, 9, 2), 1 );
+ hour := 0; min := 0; sec := 0;
+
+ if Length(inDateTimeString) > 11 then begin
+ if( inDateTimeString[13] = ':' ) and ( inDateTimeString[16] = ':' ) then begin
+ hour := StrToIntDef( Copy(inDateTimeString, 12, 1), 0 );
+ min := StrToIntDef( Copy(inDateTimeString, 14, 2), 0 );
+ sec := StrToIntDef( Copy(inDateTimeString, 17, 2), 0 );
+ end else if( inDateTimeString[14] = ':' ) and ( inDateTimeString[17] = ':' ) then begin
+ hour := StrToIntDef( Copy(inDateTimeString, 12, 2), 0 );
+ min := StrToIntDef( Copy(inDateTimeString, 15, 2), 0 );
+ sec := StrToIntDef( Copy(inDateTimeString, 18, 2), 0 );
+ end;
+ end;
+ try
+ Result := EncodeDateTime(y ,m, d, hour, min, sec, 0);
+ except
+ Result := ZERO_DATE;
+ end;
+ end else
+ Result := ZERO_DATE;
+ end;
+
+
+ // Result := inDateTimeString;