Home How To Online Documentation Support Download Order
 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric
SAInterval

Enums and Typedefs


Class Members

Examples

SADateTime object

SADateTime is a subsidiary class. The SADateTime class provides support for manipulating date/time values. It is intended to replace and extend the functionality normally provided by the C run-time library date/time package. The SADateTime class supplies member functions and operators for simplified date/time handling. The class also provides constructors and operators for constructing, and assigning SADateTime objects and standard C++ date/time data types.

A SADateTime object encapsulates the struct tm data type used in ANSI C also adding fraction of a second functionality.

To create date/time value use one of SADateTime constructors:

SADateTime( ); - default constructor, creates empty date/time value.

SADateTime( const SADateTime & ); - copy constructor, used to create new date/time value from existing SADateTime object.

SADateTime( const struct tm & ); - creates date/time value from standard C date/time structure.

SADateTime(double); - creates date/time from floating-point value (DATE data type in Windows), measuring days from midnight, 30 December 1899. So, midnight, 31 December 1899 is represented by 1.0. Similarly, 6 AM, 1 January 1900 is represented by 2.25, and midnight, 29 December 1899 is – 1.0. However, 6 AM, 29 December 1899 is – 1.25.

SADateTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec ); - use this constructor to create new date/time value by specifying different date/time components.

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.