Date format in database

Ok guys comeback again with me, sometimes it is necessary to change a date format of date field right?.. for example you need save another format date into database now may use DisplayFormat property of TDateField type when you show data from your database. this is how to use, too much simple but effective.
 
procedure TForm1.buttonclick(Sender: TObject);
begin
  with table1 do
  begin
    TDateField(FieldByName('DateNo1')).DisplayFormat:='dd-mm-yyyy';
    TDateField(FieldByName('DateNo2')).DisplayFormat:='yyyymmdd';
    Active:=True;
  end;
end;


look simple right? thank you for coming here, see you next time.

0 Response to "Date format in database"

Post a Comment