diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
commit | a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (patch) | |
tree | b88cc7a8457658d67e0321718556ac807f6bccf3 /src/myctime.c | |
parent | 00be7622c428f279872f84569f098ce16150f8a8 (diff) |
format files
Diffstat (limited to 'src/myctime.c')
-rw-r--r-- | src/myctime.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/myctime.c b/src/myctime.c index 6f554c9..ebb01ba 100644 --- a/src/myctime.c +++ b/src/myctime.c @@ -1,13 +1,12 @@ -#include "datetime.h" -#include "fmt.h" #include "myctime.h" -static char *daytab[7] = { -"Sun","Mon","Tue","Wed","Thu","Fri","Sat" -}; +#include "fmt.h" + +#include "datetime.h" + +static char *daytab[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static char *montab[12] = { -"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" -}; + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; static char result[30]; @@ -15,21 +14,21 @@ char *myctime(datetime_sec t) { struct datetime dt; unsigned int len; - datetime_tai(&dt,t); + datetime_tai(&dt, t); len = 0; - len += fmt_str(result + len,daytab[dt.wday]); + len += fmt_str(result + len, daytab[dt.wday]); result[len++] = ' '; - len += fmt_str(result + len,montab[dt.mon]); + len += fmt_str(result + len, montab[dt.mon]); result[len++] = ' '; - len += fmt_uint0(result + len,dt.mday,2); + len += fmt_uint0(result + len, dt.mday, 2); result[len++] = ' '; - len += fmt_uint0(result + len,dt.hour,2); + len += fmt_uint0(result + len, dt.hour, 2); result[len++] = ':'; - len += fmt_uint0(result + len,dt.min,2); + len += fmt_uint0(result + len, dt.min, 2); result[len++] = ':'; - len += fmt_uint0(result + len,dt.sec,2); + len += fmt_uint0(result + len, dt.sec, 2); result[len++] = ' '; - len += fmt_uint(result + len,1900 + dt.year); + len += fmt_uint(result + len, 1900 + dt.year); result[len++] = '\n'; result[len++] = 0; return result; |