Elia:
Thank you for your help.
I tried to use the following code for getting date and time. However, it
wasn't work. Would you mind take a look, and help me out.
FormPtr form;
UInt handled = 0;
UInt index;
VoidHand RecHandle;
Ptr RecPointer;
CharPtr pString;
Word error = 0;
Err err = 0;
SystemPreferencesType sysPrefs;
DateTimeType dateTime;
form = FrmGetActiveForm();
switch (event->eType)
{
case frmOpenEvent:
FrmDrawForm(form);
handled = 1;
//Get the time formats from the system preferences.
TimeFormat = sysPrefs.timeFormat;
//Get the date formats from the system preferences
LongDateFormat = sysPrefs.longDateFormat;
ShortDateFormat = sysPrefs.dateFormat;
//Get today's date
TimSecondsToDateTime (TimGetSeconds (), &dateTime);
Date.year = dateTime.year - firstYear;
Date.month = dateTime.month;
Date.day = dateTime.day;
DateToAscii((Word)Date.year,(Byte)Date.month,(Byte)Date.day,pString);
// print the time to the PC time/date field
fieldptr_datetime_date = FrmGetObjectPtr(form,
FrmGetObjectIndex(form, fieldID_datetime_date));
FldSetTextPtr(fieldptr_datetime_date, pString);
FldRecalculateField(fieldptr_datetime_date, true);
Thank you, again
Allen
-----Original Message-----
From: Elia Freedman [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 30, 1999 10:34 AM
To: [EMAIL PROTECTED]
Subject: RE: How to show system date and time in the form?
Try calling the date and time conversion routines to a string, and than
displaying each in a label or on a field.
Elia
-----Original Message-----
From: Allen Yang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 29, 1999 7:04 AM
To: [EMAIL PROTECTED]
Subject: How to show system date and time in the form?
Hi,
Anyone can show me how to show the system date and time in the form?
I created a form. In the form, I need show the PC date and time in two
different field. One is for time, and another one for date. I don't know
how to make this work?
I will appreciated any help.
allen