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>
    struct tm * localtime( const time_t *timer );
    struct tm *_localtime( const time_t *timer,
                           struct tm *tmbuf );

    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 localtime functions convert the calendar time pointed to by timer
    into a structure of type  tm, of time information, expressed as local
    time.  Whenever localtime is 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 function  _localtime places the converted time in the  tm structure
    pointed to by tmbuf, and the function  localtime places the converted
    time in a static structure that is re-used each time  localtime is
    called.

    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 localtime functions return a pointer to a  tm structure containing
    the time information.

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

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

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

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

    produces the following:

    It is now: Sat Mar 21 15:58:27 1987

Classification:
    localtime is ANSI, _localtime is not ANSI

Systems:
     localtime - All

    _localtime - All

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