Autor Beitrag
sunshineh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: So 19.10.08 12:57 
Hallo,

wie kann ich mir den Timestamp in folgendem Format ausgeben lassen: yyyy-mm-ddThh:mm:ssTZD

Gruß und Danke!
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: So 19.10.08 12:58 
mit FormatDateTime (heißt so, glaub ich). in der delphihilfe kannst du dir ansehen welche buchstaben was ersetzen.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
sunshineh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 20.10.08 10:02 
Danke, nur das mit der Sommer-/Winterzeit krieg ich irgendwie nicht hin?!
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 20.10.08 11:20 
naja, weil winter und sommerzeit gebietsabhängig ist. ich denke das musst du direkt vom BS abfragen.

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
sunshineh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: So 26.10.08 12:01 
Ich habe folgende Funktion gefunden (www.delphipraxis.net...110674,0,asc,0.html)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function GetTimeZoneBias:TDateTime; 
const 
   MINUTES_PER_DAY = 24.0 * 60.0; 
var 
  tzi : TTimeZoneInformation; 
begin 
   case GetTimeZoneInformation(tzi) of 
      TIME_ZONE_ID_STANDARD: 
         result := (tzi.Bias) / MINUTES_PER_DAY; 

      TIME_ZONE_ID_DAYLIGHT:  // Sommerzeit 
         Result := (tzi.Bias+tzi.DaylightBias) / MINUTES_PER_DAY; 
   else 
      Result := 0.0; 
   end; 
end;


und in meine Procedure gepackt. Leider überspringt das Programm die Case-Anweisung. Warum?
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 26.10.08 12:09 
Wie und wo wird die Funktion denn aufgerufen?
sunshineh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 27.10.08 09:59 
Ich habe die Funktion dieser Funktion in meine Procedure mit rein gesteckt. Result ist bei mir vom Typ Real.
Doch bei mir steht in der Variablen "tzi" nur "Westeuropäische Normalzeit" und nicht TIME_ZONE_ID_STANDARD und TIME_ZONE_ID_DAYLIGHT.
sunshineh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 27.10.08 11:11 
Ich habe es jetzt so gemacht

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
   case GetTimeZoneInformation(tzi) of
    1: R := (tzi.StandardBias + tzi.Bias)/(-60);
    2: R := (tzi.DaylightBias + tzi.Bias)/(-60);
   else
      R := 0.0;
   end;


Was zwar nicht, ob es 100%ig richtig ist, aber es scheint zu funktionieren.