delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/25/11:20:30

From: "Ike" <drone AT ismi DOT net>
Newsgroups: comp.os.msdos.djgpp
References: <371ce8c3 DOT 0 AT phisteria DOT delmarva DOT net>
Subject: Re: Programming Help
Date: Sun, 25 Apr 1999 10:51:05 -0700
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: tc3-07.ismi.net
Message-ID: <37232c3e@news.ismi.net>
X-Trace: 25 Apr 1999 10:52:46 -0400, tc3-07.ismi.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I use the functions in time.h:

#include <time.h>

int main(void)
{
   struct date d;
   getdate(&d);

   printf("Date: %i / %i / %i\n"  d.da_mon, d.da_day, d.da_year);
   return 0;
}

The date structure looks like this:

struct date {
  short da_year;
  char  da_day;
  char  da_mon;
};

David Robinson <robinson AT shore DOT intercom DOT net> wrote in message
news:371ce8c3 DOT 0 AT phisteria DOT delmarva DOT net...
> I am trying to time and date stamp data inside a file.  How would I pull
the
> time and or date into a C program?  I see there is a _dos_getdate, and a
> _dos_gettime function in the library.  How do I assign this to a variable
in
> my program?
>
> Thanks for any help!
> Dave Robinson
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019