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 * ctime( const time_t *timer );
    char *_ctime( const time_t *timer, char *buf );

Description:
    The ctime functions convert the calendar time pointed to by timer to
    local time in the form of a string.  The  ctime function is equivalent
    to


         asctime( localtime( timer ) )

    The ctime functions convert the time 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  ctime places the result string in a static buffer
    that is re-used each time  ctime or  asctime is called.  The non-ANSI
    function  _ctime places the result string in the buffer pointed to by
    buf.

    Whenever the ctime functions are called, the  tzset function is also
    called.

    The calendar time is usually obtained by using the  time function.  That
    time is Coordinated Universal Time (UTC) (formerly known as Greenwich
    Mean Time (GMT)).

    The time set on the computer with the DOS time command and the DOS date
    command reflects the local time.  The environment variable TZ is used to
    establish the time zone to which this local time applies.  See the
    section The TZ Environment Variable for a discussion of how to set the
    time zone.

Returns:
    The ctime functions return the pointer to the string containing the
    local time.

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

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

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

        time_of_day = time( NULL );
        printf( "It is now: %s", _ctime( &time_of_day, buf ) );
      }

    produces the following:

    It is now: Fri Dec 25 15:58:42 1987

Classification:
    ANSI

_ctime is not ANSI

Systems:
     ctime - All

    _ctime - All

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