Borland C++ reference

dostounix

raw OCR

Converts date and time to UNIX time format.

Defined in header <dos.h>

Syntax

#include <dos.h>
long  dostounix(struct      date  *d, struct  time   *t);

   DOS     UNIX     Windows   ANSI C    C++ only
     ■                 ■

Remarks

dostounix converts a date and time as returned from getdate and gettime into UNIX time format, d points to a date structure, and f points to a time structure containing valid DOS date and time information.

The date and time must not be earlier than or equal to Jan 1 1980 00:00:00.

Retum value

UNIX version of current date and time parameters: number of seconds since 00:00:00 on January 1,1970 (GMT).

See also

Example

#include <time.h>
#include <stddef.h>
#include <dos.h>
#include <stdio.h>

int main(void)
{
   time_t t;
   struct time d_time;
   struct date d_date;
   struct tm * local;
   getdate(&d_date)
   gettime(&d_time)
   t = dostounix (&d_date, &d_time);
   local = localtime{&t) ;
   printf("Time and Date:  %s\n", asctime(local)
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • no portability table