![]() |
![]() |
![]() |
Convert calendar time to a broken-down time
#include <time.h> struct tm* gmtime( const time_t* timer );
libc
The gmtime() function converts the calendar time pointed to by timer into a broken-down time, expressed as Coordinated Universal Time (UTC) (formerly known as Greenwich Mean Time or GMT).
The gmtime() function places the converted time in a static structure that is reused each time gmtime() is called. If you want a thread-safe version of gmtime(), try gmtime_r().
The date command sets the computer's internal clock using Coordinated Universal Time (UTC). Use the TZ environment variable to establish the local time zone. See the section "The TZ environment variable" in the Global Data and the TZ Environment Variable chapter for a discussion of how to set the time zone.
A pointer to a structure containing the broken-down time.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |
asctime(), asctime_r(), clock(), ctime(), difftime(), gmtime_r(), localtime(), localtime_r(), mktime(), strftime(), time(), tm, tzset()
![]() |
![]() |
![]() |