Autor Beitrag
lroth
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Do 16.07.09 23:49 
Hallo,
ich möchte aus Dateien die aktuell im Druckspooler stehen die Zeit auslesen, zu der sie in den Spooler gestellt wurden. Funktioniert vom Prinzip, die Zeit die ich dabei aber erhalte weicht immer 2 Std von der wirklichen Zeit auf meinem Rechner ab. Wie kann ich das korrekt ermitteln?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
   aJobs : Array[0..5000of JOB_INFO_2;
   StatusLog:String;
   //...

      SetJob(hPrinter, aJobs[i].JobId, 00, JOB_CONTROL_CANCEL);

      //Hier liegt das Problem: !!!!!!!!!!!!!!!!!!!!!!!!!!!!
      StatusLog := DateToStr(SystemTimeToDateTime(aJobs[i].Submitted)) + ' - '+
                   TimeToStr(SystemTimeToDateTime(aJobs[i].Submitted)) + ' - ' +
                   StrPas(aJobs[i].pDocument) + ' - '+ IntToStr(aJobs[i].Size);
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: Fr 17.07.09 08:35 
Schau mal, ob Du irgendwas bzgl. Zeitzone rausbekommst. Ich denk mal, die angezeigte Zeit wird UTC sein, dein System wird aber auf MESZ laufen ...

_________________
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.
ffgorcky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 573

WIN XP/2000 & 7Prof (Familie:Win95,Win98)

BeitragVerfasst: So 19.07.09 09:14 
Also da musste ich erst mal nach suchen, was denn nun genau UTC und MESZ sind - und habe hier die Antwort gefunden:
Zeitumstellung bei Uhrzeit.org
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19313
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 19.07.09 09:22 
Das geht mit GetTimeZoneInformation:
msdn.microsoft.com/e...ibrary/ms724421.aspx
Hier siehst du wie das geht:
www.delphipraxis.net/topic7326.html
lroth Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: So 19.07.09 09:53 
Danke allen, das hat geholfen !!!