I am using FileDatetoDateTime and FileAge to get the date and time stamp of a list of files. The date stamp is working fine. The time stamp is off. example of code below:
z := RZFileListBox1.Items.Count;
for x := 0 to z-1 do
begin
holdext := '';
holddatestamp := '';
FileNameEdit.Text := RZFileListBox1.Items.Strings[x];
holddate := FileDatetoDateTime(FileAge(FileNameEdit.Text));
holddatestamp := FormatDateTime('mm/dd/yy hh:ss AM/PM', holddate);
y := pos('S.wav', RZFileListBox1.Items.Strings[x]);
holdext := trim(copy(RZFileListBox1.Items.Strings[x], y-4, 4));
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update TeacherNames set LastAccessed = :holddatestamp '+
' where classcode = :holdext ');
Query1.ParamByName('holddatestamp').AsString := holddatestamp;
Query1.ParamByName('holdext').AsString := holdext;
Query1.ExecSQL;
end;
I am updating a table in Access with the date and time stamp. When I compare that date and time stamp value with what is actually in the directory, I see a difference in the time. The value I get from FileDatetoDateTime Problem may say something like 09/04/03 10:52AM and the directory may say 09/04/03 10:13AM. Another example is my value will say 09/03/03 12:14PM and the directory displays 09/03/03 12:59PM. Any idea why? Thanks!
z := RZFileListBox1.Items.Count;
for x := 0 to z-1 do
begin
holdext := '';
holddatestamp := '';
FileNameEdit.Text := RZFileListBox1.Items.Strings[x];
holddate := FileDatetoDateTime(FileAge(FileNameEdit.Text));
holddatestamp := FormatDateTime('mm/dd/yy hh:ss AM/PM', holddate);
y := pos('S.wav', RZFileListBox1.Items.Strings[x]);
holdext := trim(copy(RZFileListBox1.Items.Strings[x], y-4, 4));
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update TeacherNames set LastAccessed = :holddatestamp '+
' where classcode = :holdext ');
Query1.ParamByName('holddatestamp').AsString := holddatestamp;
Query1.ParamByName('holdext').AsString := holdext;
Query1.ExecSQL;
end;
I am updating a table in Access with the date and time stamp. When I compare that date and time stamp value with what is actually in the directory, I see a difference in the time. The value I get from FileDatetoDateTime Problem may say something like 09/04/03 10:52AM and the directory may say 09/04/03 10:13AM. Another example is my value will say 09/03/03 12:14PM and the directory displays 09/03/03 12:59PM. Any idea why? Thanks!