lxpbuaa Posted September 17, 2018 Share Posted September 17, 2018 Hi, I uses a uniDateTimePicker to edit a datetime column of a DBGrid. The field type is TSQLTimeStampField. There are 2 problems: 1. When enter the editor and leave it, the date (e.g "2018-01-11") always changes to a GMT datetime text. 2. Atfer change the date value, the error "Could not parse SQL TimeStamp string" raises. Thanks! Quote Link to comment Share on other sites More sharing options...
lxpbuaa Posted September 17, 2018 Author Share Posted September 17, 2018 I asked myself: 1. FireDAC deals all date/time field as SQLTimeStamp field, and uniDateTimePicker ignores the prolem. To solve this prolem as: FConnection.FormatOptions.OwnMapRules := True; with FConnection.FormatOptions.MapRules.Add do begin SourceDataType := dtDateTimeStamp; TargetDataType := dtDateTime; end; 2. Another prolem, uniDateTimePicker raises "xxxx-xx-xx" is not valid date time. uniDBGrid.pas has codes as below: SetFldValue…… D := StrToDateTime(AVal, FmtSettings); --FmtSettings is a new global var in uniGUIApplication, why don't use SysUtils.FormatSettings? Change values of FmtSettings and the prolem solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.