Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <time.h>
    char * asctime( const struct tm *timeptr );
    char *_asctime( const struct tm *timeptr, char *buf );

    struct  tm {
      int tm_sec;   /* seconds after the minute -- [0,61] */
      int tm_min;   /* minutes after the hour   -- [0,59] */
      int tm_hour;  /* hours after midnight     -- [0,23] */
      int tm_mday;  /* day of the month         -- [1,31] */
      int tm_mon;   /* months since January     -- [0,11] */
      int tm_year;  /* years since 1900                   */
      int tm_wday;  /* days since Sunday        -- [0,6]  */
      int tm_yday;  /* days since January 1     -- [0,365]*/
      int tm_isdst; /* Daylight Savings Time flag */
    };

Description:
    The asctime functions convert the time information in the structure
    pointed to by timeptr into a string containing exactly 26 characters.
     This string has the form shown in the following example:


         Sat Mar 21 15:58:27 1987\n\0

    All fields have a constant width.  The new-line character '\n' and the
    null character '\0' occupy the last two positions of the string.

    The ANSI function  asctime places the result string in a static buffer
    that is re-used each time  asctime or  ctime is called.  The non-ANSI
    function  _asctime places the result string in the buffer pointed to by
    buf.

Returns:
    The asctime functions return a pointer to the character string result.

See Also:
    clock, ctime Functions, difftime, gmtime Functions, localtime Functions, mktime, strftime, time, tzset

Example:
    #include <stdio.h>
    #include <time.h>

    void main()
      {
        struct tm  time_of_day;
        time_t     ltime;
        auto char  buf[26];

        time( &ltime );
        _localtime( &ltime, &time_of_day );
        printf( "Date and time is: %s\n",
                _asctime( &time_of_day, buf ) );
      }

    produces the following:

    Date and time is: Sat Mar 21 15:58:27 1987

Classification:
    ANSI

_asctime is not ANSI

Systems:
     asctime - All

    _asctime - All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson