www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/18/10:39:11

Date: Wed, 18 Dec 1996 17:25:01 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Murray Stokely <murray AT southeast DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP Date and Time Functions
In-Reply-To: <32b78191.575478992@nntp.southeast.net>
Message-ID: <Pine.SUN.3.91.961218172012.23536G-100000@is>
MIME-Version: 1.0

On Wed, 18 Dec 1996, Murray Stokely wrote:

>       Can someone please explain to me how to make sense of the
> date/time functions in DJGPP?  It seems to be a very unorganized mix
> of Dos and Unix commands.  Like how do I simply display the LOCAL date
> and time?

Sigh...  I wonder if people actually care to look into the docs before 
posting such question.

The following is an excerpt from the libc reference which comes with 
DJGPP.  After you read it, please tell me: what can be more clear than 
this?


  asctime
  =======

  Syntax
  ------

     #include <time.h>

     char *asctime(const struct tm *tptr);

  Description
  -----------

  This function returns an ASCII representation of the time represented by
  TPTR.  The string returned is always 26 characters and has this format:

     Sun Jan 01 12:34:56 1993\n\0

  The string pointed to is in a static buffer and will be overridden with
  each call to asctime.  The data should be copied if it needs to be
  preserved.

  Return Value
  ------------

  A pointer to the string.

  Example
  -------

     time_t now;
     time(&now);
     printf("The current time is %s", asctime(localtime(&now)));

- Raw text -


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