7526 DCT Reference


Reference&mdash.Date/Time

reference&mdash.date/time

RtcGetAsciiDate

This function returns the date in ASCII format. The returned string is null-terminated. If the DEFAULT_DATE is requested, no data is placed in the buffer. If another option is selected, the date is returned in the requested format.

Note:

The buffer must be at least seven (7) bytes and the DEFAULT_DATE requires one (1) byte to return the null character, even though there is no data.

.

C Format

     #include   "cfrapi26.h"          // For defined values
 
     USHORT     RtcGetAsciiDate(format, buffer, default_format)
 
     UCHAR      format                // Format of date
     UCHAR      *buffer               // Pointer to date buffer
     UCHAR      *default_format       // Pointer to returned
                                      //  default format.
 
     Returns:   E_OK                  // If no error occurred
                E_PARAM               // If format was invalid

Masm Format

     Input:    ah = 0
               al = 0       Return date in default format
                    1       Return date as MMDDYY
                    2       Return date as DDMMYY
                    3       Return date as YYMMDD
                    4       Return date as JJJYY
                    5       Return date as YYJJJ
                es:bx = buffer
 
     Call:     INT 42h
 
     Returns:  bl = default_format
               ax = 0       If no error occurred
                    1       If the specified format was invalid

Comments:

Defined values for date format are:

Example

int far main (int funct,char far *params)

RtcGetAsciiTime

This function returns the time in ASCII format. The returned string is null-terminated. This function returns the time in ASCII format. The returned string is null-terminated. If the DEFAULT_TIME is requested, no data is placed in the buffer. If another option is selected, the date is returned in the requested format.

Note:

The buffer must be at least seven (7) bytes and the DEFAULT_TIME requires one (1) byte to return the null character, even though there is no data.

.

C Format

     #include   "cfrapi26.h"          // For defined values
 
     USHORT     RtcGetAsciiTime(format, buffer, default_format)
 
     UCHAR      format                // Format of time
     UCHAR      *buffer               // Pointer to time buffer
     UCHAR      *default_format       // Pointer to returned
                                      //  default format.
 
     Returns:   E_OK                  // If no error occurred
                E_PARAM               // If format was invalid

Masm Format

     Input:    ah  = 1
               al  = 0      Return time in default format
                     1      Return time in 12 hour-format
                     2      Return time in 24 hour-format
               es:bx = buffer
 
     Call:     INT 42h
 
     Returns:  bl = default_format
               ax = 0       If no error occurred
                    1       If the specified format was invalid

Comments:

An AM or PM is appended to the end of the time string in 12-hour format.

Defined values for time format are:

Example

int far main (int funct,char far *params)