Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 26.12.06 10:48 
Hi, Delpher,

ich möchte alle Dateien sichern, deren FileAge nicht älter ist als 28 Tage.

Wenn das Dateidatum zwischen heute und gestern liegt, mache ich es so:

ausblenden Delphi-Quelltext
1:
2:
3:
if (filedatetodatetime(fileage(findrec.name)) = heute) or
   (incday(filedatetodatetime(fileage(findrec.name))) = heute) then
sichern(self);


Aber wie bekomme ich den gewünschten Zeitraum eingepackt?


Danke für Hilfe, Detlef
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 26.12.06 10:52 
ausblenden Delphi-Quelltext
1:
2:
if DaysBetween(FileDateToDateTime(FileAge(FindRec.Name)), Now) < 28 then
  Sichern(Self);

Oder auf pseudo-codisch:
ausblenden Quelltext
1:
2:
Wenn weniger als 28 Tage zwischen Heute und dem Erstellungsdatum der Datei liegen, dann
  Sichere(Datei);

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 26.12.06 10:59 
Hi, Fabi,

war das jetzt ein neuer Thread-Lösezeit-Rekord?

Danke für deine seehr schnelle Antwort!

Detlef
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 26.12.06 11:01 
War nur zufällig grad hier ;-).

Wenn du den 28. Tag noch mit einschließen willst, musst du natürlich <= statts < schreiben. Aber das weißte bestimmt :-).

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 26.12.06 11:11 
Hab ich schon gesetzt, dat wusste ick...
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 26.12.06 14:10 
Thread-Lösezeit von 4 Minuten ist noch recht langsam ... Glaube der Rekord liegt bei knapp ner Minute oder so ... Hatte gestern erst nen Thread, wo der entscheidende Post innerhalb von 210 Sekunden kam ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 26.12.06 21:01 
Hi, Benni,

wir arbeiten dran ... übrigens, die Antwort war nach <= 2 Minuten da, mit meiner Antwort waren es 4 Minuten!
(Detlef)