Ich versuche seit iniger Zeit in einem EMX/C++-Programm unter OS/2 das
aktuelle Datum zu ermitteln.
Nach laengerer Suche in der Dokumentation bin ich auf die Funktionen
asctime(), ctime(),.. gestossen.
Und habe versucht aus den R ckgabewerten dieser Funktionen das Datum
zu gewinnen.
Das ist mir anscheinend auch gelungen. Nur leider ist das Datum
welches ich so erhalte verkehrt. Gestern Abend erhielt ich zum
Beispiel als Ergebnis 4.Jan.1970. (Mein Rechner Datum stimmt
uebrigens.
Kann es sein das die Funktionen fehlerhaft arbeiten.
Kennt jemand eine funktionierende Moeglichkeit. Eventuell eine
einfachere L”sung die ich uebersehen habe?
Danke im vorraus.
ÍÍÍ
"Microsoft announces complete year 2000 solution. Delivery expected in
2004."
ÍÍÍ
EMAIL from Barnie (Christoph Reimer): bar...@earthcorp.com
Website: www.earthcorp.com/barnie
Please do not send commercial mail to this account
CR>Eventuell eine einfachere Lösung die ich uebersehen habe?
in der Visual Age C++ Doku wird folgende Systemfunktion erwähnt:
/*******************************************/
/* DosGetDateTime gets the current date */
/* and time. */
/*******************************************/
#define INCL_DOSDATETIME
#include <os2.h>
PDATETIME pdt; /* Pointer to the DateTime data structure. */
APIRET ulrc; /* Return Code. */
ulrc = DosGetDateTime(pdt);
mit
DateTime data structure.
typedef struct _DATETIME {
UCHAR hours; /* Current hour, using values 0 through 23. */
UCHAR minutes; /* Current minute, using values 0 through 59. */
UCHAR seconds; /* Current second, using values 0 through 59. */
UCHAR hundredths; /* Current hundredths of a second, using values 0
through 99. */
UCHAR day; /* Current day of the month, using values 1 through 31.
*/
UCHAR month; /* Current month of the year, using values 1 through
12. */
USHORT year; /* Current year. */
SHORT timezone; /* The difference in minutes between the current time
zone and Greenwich Mean Time (GMT). */
UCHAR weekday; /* Current day of the week, using values 0 through 6.
*/
} DATETIME;
typedef DATETIME *PDATETIME;
Diese Funktion sollte eigentlich auch unter EMX/G++ verfügbar sein.
Hej d†, Marco