Seite 1 von 1

Microsoft-COM-Type "DATE"

Verfasst: 25.02.2009 14:15
von 7x7
Gibt es in PB für den Standard-Microsoft-COM-Type "DATE" eine einfache Übersetzungsmethode?
Oder gar einen entsprechenden Variablentyp (bin mir nicht sicher, ob ich im Moment einfach
nur blind bin)? Habe das Problem, daß ich VB-Daten aus einer Datei umsetzen muss.

Code: Alles auswählen

DATE:
A 8 byte floating point number. Days are represented by 
whole number increments starting with 30 December 1899, 
midnight as time zero. Hour values are expressed as the 
absolute value of the fractional part of the number. In 
the interfaces described here all dates and times are 
in UTC.

Verfasst: 25.02.2009 14:35
von ts-soft
Die "VariantHelper_Include.pb" von mk-soft könnte helfen :wink:
Die befindet sich z.B. in COMate, ScriptControl oder PureDisphelper.
Direkten link zu mk-soft habe ich leider nicht.

Verfasst: 25.02.2009 17:32
von 7x7
Danke ts-soft!

Bin inzwischen auch etwas weiter gekommen. Die Umwandlung ist eigentlich ganz einfach.
Sollte mal jemand vor dem gleichen Problem stehen; hier bitte:

Code: Alles auswählen

MS_COM_Datum.d=ReadDouble(tlc)

Debug FormatDate("%dd.%mm.%yyyy  %hh:%ii:%ss", (MS_COM_Datum-25569)*86400)

Verfasst: 25.02.2009 21:53
von mk-soft
Wenn Unix Format nicht mehr reichen sollte
http://www.purebasic.fr/german/viewtopic.php?t=14159

FF :wink: