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>
    struct tm * gmtime( const time_t *timer );
    struct tm *_gmtime( 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 gmtime functions convert the calendar time pointed to by timer into
    a broken-down time, expressed as Coordinated Universal Time (UTC)
    (formerly known as Greenwich Mean Time (GMT)).

    The function  _gmtime places the converted time in the  tm structure
    pointed to by tmbuf, and the gmtime gmtime places the converted time in
    a static structure that is re-used each time gmtime 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 gmtime functions return a pointer to a structure containing the
    broken-down time.

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 );
        _gmtime( &time_of_day, &tmbuf );
        printf( "It is now: %.24s GMT\n",
                _asctime( &tmbuf, buf ) );
      }

    produces the following:

    It is now: Fri Dec 25 15:58:27 1987 GMT

Classification:
    gmtime is ANSI, _gmtime is not ANSI

Systems:
     gmtime - All, Netware

    _gmtime - All

See Also:
    asctime, clock, ctime, difftime, 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