Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : mktime

time_tmktime(struct tm * timeptr) ;

Return Type : time_t

Integer type for timestamps (seconds since epoch)
Read about return values of mktime function .

1st Parameter Type : struct tm *

A pointer to a `struct tm`, which represents a broken-down calendar time. The structure contains fields such as year, month, day, hour, minute, and second for representing human-readable time.

1st Parameter

Pointer to a `struct tm` representing a broken-down local time. The fields are adjusted and normalized by the function.

Read more about parameters of mktime in parameters section
The mktimefunction in C language Converts a time structure to calendar time.
The mktime function converts a local time, expressed as a struct tm, into a calendar time value of type time_t. The function also normalizes the contents of the struct tm, so that each member is in the correct range.
The mktimefunction takes 1 parameter:
  • struct tm * `timeptr`: Pointer to a `struct tm` representing a broken-down local time. The fields are adjusted and normalized by the function.
Converts the broken-down local time represented by `timeptr` into a `time_t` value, which represents the time in seconds since the epoch (00:00:00 UTC, January 1, 1970). Normalizes the fields of the `struct tm` and modifies it to reflect the local time. Returns the `time_t` value, or `(time_t)-1` if the time cannot be represented.
The mktime function return value :
  • Returns the calendar time encoded as a time_t value, or (time_t)(-1) if the time cannot be represented

Output

This example demonstrates basic usage of mktime to convert a struct tm to a time_t value.