Scroll Down to See All▾
abortabsacosasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1ynFunction Details : asctime
char *asctime(const struct tm * timeptr) ;
Return Type : char *
String pointer (array of characters)
Read about return values of asctime function .
1st Parameter Type : const struct tm *
Pointer to a constant `struct tm`, which represents broken-down time values including year, month, day, hour, minute, and second.
1st Parameter
Pointer to a `struct tm` representing broken-down time
Read more about parameters of asctime in parameters section
The asctimefunction in C language Converts a time structure to a string representation.
The asctime function converts a time structure (struct tm) to a string representation. It returns a pointer to a static character string of the form: 'Day Mon dd hh:mm:ss yyyy\n'. Note that this function is not thread-safe as it returns a pointer to a static buffer. For a thread-safe version, consider using asctime_r or strftime.
The asctimefunction takes 1
parameter:Converts a `struct tm` time to a human-readable string in the format 'Day Mon DD HH:MM:SS YYYY\n'.
- •const struct tm * `timeptr`: Pointer to a `struct tm` representing broken-down time
The asctime function return value :
- Returns a pointer to a null-terminated string containing the date and time information in a standard format
- This pointer is to a static buffer that may be overwritten by subsequent calls to asctime
Output
This example demonstrates the basic usage of the `asctime` function to convert the current local time to a string representation.