mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Shorten timestamp
We do not need the date part of the timestamp. It simply takes up too much precious line space. In case of logging to file, one can easily conclude the date from the file date information.
This commit is contained in:
parent
59c9b867c3
commit
c0c9fcc00c
1 changed files with 3 additions and 3 deletions
|
|
@ -28,8 +28,8 @@
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
|
|
||||||
// "YYYY-MM-DDThh:mm:ss.sss" (ISO-8601 format).
|
// "hh:mm:ss.sss"
|
||||||
#define TIME_STRING_SIZE 24
|
#define TIME_STRING_SIZE 15
|
||||||
|
|
||||||
char * current_time(void)
|
char * current_time(void)
|
||||||
{
|
{
|
||||||
|
|
@ -46,7 +46,7 @@ char * current_time(void)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t len = strftime(time_string, sizeof(time_string), "%Y-%m-%dT%H:%M:%S", tmp);
|
size_t len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tmp);
|
||||||
if (len) {
|
if (len) {
|
||||||
len = snprintf(time_string + len, TIME_STRING_SIZE - len, ".%03ld", (long)tv.tv_usec / 1000);
|
len = snprintf(time_string + len, TIME_STRING_SIZE - len, ".%03ld", (long)tv.tv_usec / 1000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue