summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/sys/time.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/common/sys/time.c b/common/sys/time.c
index 8564b514..bf8164c9 100644
--- a/common/sys/time.c
+++ b/common/sys/time.c
@@ -39,7 +39,7 @@ int getHoroscope(int m, int d)
/**
* 23+1 bytes, "12/31/2007 00:00:00 Mon\0"
*/
-char *
+const char*
Cdate(const time4_t *clock)
{
time_t temp = (time_t)*clock;
@@ -52,7 +52,7 @@ Cdate(const time4_t *clock)
/**
* 19+1 bytes, "12/31/2007 00:00:00\0"
*/
-char *
+const char*
Cdatelite(const time4_t *clock)
{
time_t temp = (time_t)*clock;
@@ -65,7 +65,7 @@ Cdatelite(const time4_t *clock)
/**
* 10+1 bytes, "12/31/2007\0"
*/
-char *
+const char*
Cdatedate(const time4_t * clock)
{
time_t temp = (time_t)*clock;
@@ -75,6 +75,19 @@ Cdatedate(const time4_t * clock)
return cdate_buffer;
}
+/**
+ * 11+1 bytes, "12/31 10:01\0"
+ */
+const char*
+Cdate_mdHM(const time4_t * clock)
+{
+ time_t temp = (time_t)*clock;
+ struct tm *mytm = localtime(&temp);
+
+ strftime(cdate_buffer, sizeof(cdate_buffer), "%m/%d %H:%M", mytm);
+ return cdate_buffer;
+}
+
#ifdef TIMET64
char *
ctime4(const time4_t *clock)
@@ -103,7 +116,7 @@ time4_t time4(time4_t *ptr)
}
#endif
-char *
+const char*
my_ctime(const time4_t * t, char *ans, int len)
{
struct tm *tp;