mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 20:13:31 +00:00
6a145a9262
- Add hierarchical auto-completion to redbean's repl - Fetch latest localtime() and strftime() from Eggert - Shave a few milliseconds off redbean start latency - Fix redbean repl with multi-line statements - Make the Lua unix module code more elegant - Harden Lua data structure serialization
13 lines
402 B
C
13 lines
402 B
C
#include "libc/calls/weirdtypes.h"
|
|
#include "libc/time/time.h"
|
|
|
|
char *ctime(const time_t *timep) {
|
|
/*
|
|
** Section 4.12.3.2 of X3.159-1989 requires that
|
|
** The ctime function converts the calendar time pointed to by timer
|
|
** to local time in the form of a string. It is equivalent to
|
|
** asctime(localtime(timer))
|
|
*/
|
|
struct tm *tmp = localtime(timep);
|
|
return tmp ? asctime(tmp) : NULL;
|
|
}
|