Hi,
There are a couple of points to consider in your situation:
1. If you just want the local machine date, you could use the Today() function embeding it within the String() function for the right format. This would be fine for most reports.
2. If you are inserting data into a database, you would do well to get the Server-Date from your database and then populate the value. You could write a Global function to do this so it could be re-used. Following is the code for Oracle database:
///////////////////////////////////////////////////////////////
FUNCTION integer f_Today( REF dateTime ldt_Today )
///////////////////////////////////////////////////////////////
// The System-date value is passed by reference here
///////////////////////////////////////////////////////////////
uLong lul_Handle ;
////////////////////
//
SetNull( ldt_Today ) ; // Init!
//
// Check for Database connection
lul_Handle = SQLCA.DBHandle() ;
//
IF IsNull( lul_Handle ) OR lul_Handle <= 0 THEN
RETURN -1 ; // Failure
END IF ;
//
SELECT SysDate
INTO :ldt_Today
FROM DUAL
USING SQLCA ;
//
IF SQLCA.SQLCode <> 0 THEN
SetNull( ldt_Today ) ; // Init!
END IF ;
//
RETURN 1 ; // Success
///////////////////////////////////////////////////////////////
Regards,
--
PowerObject!
---------------------------------------------------