AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Code-Bibliothek Library: Sonstiges Delphi Aktuelle Systemzeit als UnixTime(-Stamp)
Thema durchsuchen
Ansicht
Themen-Optionen

Aktuelle Systemzeit als UnixTime(-Stamp)

Ein Thema von Proddi · begonnen am 4. Sep 2003
Antwort Antwort
Proddi

Registriert seit: 4. Sep 2003
9 Beiträge
 
#1

Aktuelle Systemzeit als UnixTime(-Stamp)

  Alt 4. Sep 2003, 14:45
Für alle die, die die aktuelle Systemzeit als Unix-Timestamp brauchen:
Daraus lässt sich nat. auch eine beliebige Zeit in UnixTime wandeln...
Delphi-Quellcode:
function GetUnixTime: int64;
var
  st:_SYSTEMTIME;
  ft:_FILETIME;
begin
  // first get windows SYSTEMTIME in UTC / GMT
  GetSystemTime(st);
  // now convert to windows FILETIME
  SystemTimeToFileTime(st, ft);
  // now to UNIXTIME
  result := round((int64(ft) - int64(116444736000000000)) / 10000000);
end;
[edit=Daniel B]Delphi-Tags korrigiert. Mfg, Daniel B[/edit]
[edit=Chakotay1308]Funktion korrigiert. Mfg, Chakotay1308[/edit]
[edit=Matze]Code formatiert. Mfg, Matze[/edit]
[edit=Chakotay1308]Klassifizierung. Mfg, Chakotay1308[/edit]
[edit=fkerber]Neu abgespeichert wg. Code-Highlighting. Mfg, fkerber[/edit]
  Mit Zitat antworten Zitat
Antwort Antwort

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz