Defective snippet (I tried to clean it up for the question and mangled it
instead).
The correct snippet (which still is missing four years...)
char Date[11];
{
DateType sDate;
DateSecondsToDate(TimGetSeconds(), &sDate);
DateToAscii(sDate.month, sDate.day, sDate.year, dfMDYWithSlashes, Date);
}
John Kelsey
Director, Project Management
Tacit Solutions, Inc.
Voice (812) 423-7800
Fax (812) 423-7801
Email [EMAIL PROTECTED]
-----Original Message-----
From: John Kelsey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 08, 1999 7:49 AM
To: [EMAIL PROTECTED]
Subject: 4 Years Lost between TimGetSeconds and DateSecondsToDate
Fellow Developers,
Can any one confirm or deny a bug or documentation shortcoming... or explain
what I'm doing wrong?
I think the code snippet below should load Date[] with the current date yet
it is always 4 years off (99->95). I'm guessing it's because
TimGetSeconds() returns seconds since 1904 but DateSecondsToDate() wants
seconds since 1900 (despite what the documentation says).
Is the documentation Wrong?
Is there a bug?
Is there a defect in my code?
Is there a better (and correct) way of doing this?
char Date[11];
{
DateType sDate;
DateSecondsToDate(TimGetSeconds(), &sDate);
DateToAscii(Month, Day, Year, dfMDYWithSlashes, Date);
}
John Kelsey
Director, Project Management
Tacit Solutions, Inc.
Voice (812) 423-7800
Fax (812) 423-7801
Email [EMAIL PROTECTED]