amiga-tz/library/time_gmtsub.c

26 lines
569 B
C

#include "time_header.h"
/**
* @brief
* gmtsub is to gmtime as localsub is to localtime.
*
*/
struct tm *gmtsub(
struct state const *sp,
time_t const *timep,
int_fast32_t offset,
struct tm *tmp)
{
struct tm* result;
result = timesub(timep, offset, gmtptr, tmp);
/*
* Could get fancy here and deliver something such as
* "UT+xxxx" or "UT-xxxx" if offset is non-zero,
* but this is no time for a treasure hunt.
*/
tmp->tm_zone = ((char *)(offset ? wildabbr : gmtptr ? gmtptr->chars : gmt));
return result;
}