Highly Reusable Software
#License - #Source code - #Example Use -
#include <librock/target/types.c> #include <librock/datime.h> librock_TIME_T librock_body_mkgmtime( const librock_STRUCT_TM *tmptr, librock_TIME_T *ret );
This operates as ANSI mktime(), but interprets the members of struct tm according to UTC.
tm_year is the year-1900. tm_mon is the month 0-11 tm_mday is the day of month 1-31 tm_hour is the hour 0-23 tm_min is the minute 0-59 tm_sec is the second 0-59. tm_isdst is ignored. Typical use is to convert stored dates and times in UTC to a time_t. For something that scans strings of GMT dates and times, see librock_ssgmtime(). #ifdef librock_TYPICAL_USE_mkgmtime #include <time.h> struct tm tmbuf; time_t t; tmbuf.tm_year = 2002-1900; tmbuf.tm_mon = 1; tmbuf.tm_mday = 2; tmbuf.tm_hour = 2; tmbuf.tm_min = 2; tmbuf.tm_sec = 2; tmbuf.tm_isdst = 0; /* Ignored */ librock_mkgmtime(&tmbuf,&t); printf("%ld\n",(long) t); #endif
//No external calls.
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com Licensed under BSD-ish license, NO WARRANTY. Copies must retain this block. License text in <librock/license/librock.txt> librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.