NWPackDateTime(3nw)


NWPackDateTime -- packs a date and time into an nuint32

Synopsis

   #include <nwmisc.h> 
   or 
   #include <nwcalls.h> 
   

nuint32 N_API NWPackDateTime (NW_DATE N_FAR * sDate, NW_TIME N_FAR * sTime);

Description

The parameters are as follows:

sDate
(IN) Points to NW_DATE(optional).

sTime
(IN) Points to NW_TIME(optional).

Return values

0x0000
SUCCESSFUL

Notices

NWPackDateTime returns the packed date and time. If a parameter is NULL, the associated bits will be set to zero.

Many functions return dates in a packed format identical to that defined by DOS. Time occupies the low order word and date occupies the high order word. The bits are defined as follows:

   0-4     seconds divided by two 
   5-10    minutes 
   11-15   hours (0-23) 
   16-20   day 
   21-24   month 
   25-31   year minus 1980 

Since hours is defined as a nuint16, NW_TIME takes a nuint32 of space.

NWPackDateTime does no validity checking on the passed information. The programmer should ensure dates and/or times in the associated structures are valid before passing them to NWPackDateTime.

Services

Miscellaneous

NCP calls

None

References

NWUnpackDateTime(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.