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 Library Reference - <u>synopsis:</u> 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 );
    wchar_t * _wasctime( const struct tm *timeptr );
    wchar_t *__wasctime( const struct tm *timeptr, wchar_t *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.

    The  _wasctime and  __wasctime functions are identical to their  asctime
    and  _asctime counterparts except that they deal with wide-character
    strings.

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

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:
    asctime is ANSI, _asctime is not ANSI, _wasctime is not ANSI, __wasctime
    is not ANSI

Systems:
     asctime - All, Netware

    _asctime - All, Netware
    _wasctime - All
    __wasctime - All

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

See Also: clock difftime

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