{"id":227,"date":"2007-05-12T17:14:52","date_gmt":"2007-05-12T15:14:52","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/setfiledate\/"},"modified":"2007-05-12T17:14:53","modified_gmt":"2007-05-12T15:14:53","slug":"setfiledate","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/setfiledate\/","title":{"rendered":"SetFileDate"},"content":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]procedure TForm1.Button1Click(Sender: TObject);<br \/>\n Var<br \/>\n  S1 : String;<br \/>\n  FHan : Integer;<br \/>\n  I2 : Integer;<br \/>\n  S2 : String;<br \/>\n  S3 : String;<br \/>\n  FStruct : TOFSTRUCT;<br \/>\n  FStruct2 : TOFSTRUCT;<br \/>\n  TheDate : TDateTime;<br \/>\n  TheDate2 : TDateTime;<br \/>\n  FHan2 : Integer;<br \/>\n  I3 : Integer;<br \/>\nbegin<br \/>\n S3 := Directory95ListBox1.Directory;<br \/>\n If S3[Length(S3)] <> &#8216;\\&#8217; Then S3 := S3 + &#8216;\\&#8217;;<\/p>\n<p> S1 := FileListBox1.Filename;<br \/>\n \/\/ Here is another file to get the date from<br \/>\n S2 := S3 + FileListBox1.Items.Strings[5];<br \/>\n FHan2 := OpenFile(PChar(S2), FStruct2, OF_READWRITE);<br \/>\n I2 := FileGetDate(FHan2);<br \/>\n \/\/ ^^^^^^<br \/>\n FHan := OpenFile(PChar(S1), FStruct, OF_READWRITE);<br \/>\n I3 := FileSetDate(FHan, I2);<br \/>\n TheDate := FileDateToDateTime(I2);<br \/>\n TheDate2 := FileDateToDateTime(I2);<br \/>\n _lclose(FHan);<br \/>\n _lclose(FHan2);<br \/>\n  Label1.Caption := DateTimeToStr(TheDate);<br \/>\n  Label2.Caption := IntToStr(I3);<br \/>\nend;<br \/>\n[\/code]<\/p>\n<p>[tags]Delphi, System, Files[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]procedure TForm1.Button1Click(Sender: TObject); Var S1 : String; FHan : Integer; I2 : Integer; S2 : String; S3 : String; FStruct : TOFSTRUCT;&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[75,112,113],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-3F","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/227"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}