summaryrefslogtreecommitdiff
path: root/src/myctime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/myctime.c')
-rw-r--r--src/myctime.c29
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;