PatchworkOS
3984a1d
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
asctime.c
Go to the documentation of this file.
1
#include <
stdio.h
>
2
#include <
time.h
>
3
4
char
*
asctime
(
const
struct
tm
*
timeptr
)
5
{
6
static
char
days
[7][4] = {
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
7
8
static
char
months
[12][4] = {
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
9
10
static
char
buffer
[26];
11
sprintf
(
buffer
,
"%s %s%3d %.2d:%.2d:%.2d %d\n"
,
days
[
timeptr
->tm_wday],
months
[
timeptr
->tm_mon],
timeptr
->tm_mday,
12
timeptr
->tm_hour,
timeptr
->tm_min,
timeptr
->tm_sec,
timeptr
->tm_year + 1900);
13
return
buffer
;
14
}
asctime
char * asctime(const struct tm *timeptr)
Definition
asctime.c:4
y
int64_t y
Definition
main.c:153
buffer
EFI_PHYSICAL_ADDRESS buffer
Definition
mem.c:15
stdio.h
sprintf
_PUBLIC int sprintf(char *_RESTRICT s, const char *_RESTRICT format,...)
Definition
sprintf.c:5
tm
Definition
time.h:21
time.h
src
libstd
user
functions
time
asctime.c
Generated on Sat Jan 10 2026 00:03:16 for PatchworkOS by
1.9.8