I am trying to display the database creation date,
for an application database.  I am using the code below
but it does not seem to work.

The problem is that the date that is returned (or displayed)
is always incorrect (3/15/06).  This date varies.  If I restore from
a backed up DB, it is different.  Also, I deleted the DB and created
it again and the date shows up still different than the current 
date (ie. 10/19/09).  I would think that several DBs created within
a few minutes of each other would have the same creation date.  But
this code returns different values.

1) What is wrong with this method of returning the creation date?
   Or, how do I display the creation date?

2) Is this date created automatically when the DB is created? Or, do
I have to set the creation date myself?

3) Is there any way of getting the current time/date, other than 
TimGetSeconds (from 1/1/04) and calculating it?


// event handler for the button that displays creation date
// temp is declared globally as char temp[40]
// locID is declared globally as LocalID locID
if(event->data.ctlEnter.controlID == btnCreationDate) {
    DateType date;
    ULong   days;
                
    locID = DmFindDatabase(0, "MyTestDB");  // locID defined globally
    DmDatabaseInfo(0, locID,0,0,0,&days,0,0,0,0,0,0,0);
    // days = creation date; days from 1/1/04 ???
    DateDaysToDate(days, &date);        // convert days to DateType
    DateToAscii((Byte) date.month,(Byte) date.day, (Word) date.year,
        (DateFormatType)PrefGetPreference(prefDateFormat), temp);
    FrmCustomAlert(altNotice, "Database Info:", "Creation Date",
        temp);  // displays creation date ??? 
    break;
}     

--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

Reply via email to