mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Fix timestamp miliseconds bug
This commit is contained in:
parent
a56db8744b
commit
d598fa76a7
1 changed files with 4 additions and 2 deletions
|
|
@ -55,7 +55,8 @@ char *current_time(void)
|
||||||
case TIMESTAMP_NONE:
|
case TIMESTAMP_NONE:
|
||||||
case TIMESTAMP_24HOUR:
|
case TIMESTAMP_24HOUR:
|
||||||
// "hh:mm:ss.sss" (24 hour format)
|
// "hh:mm:ss.sss" (24 hour format)
|
||||||
tm = localtime(&tv_now.tv_sec);
|
tv = tv_now;
|
||||||
|
tm = localtime(&tv.tv_sec);
|
||||||
len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tm);
|
len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tm);
|
||||||
break;
|
break;
|
||||||
case TIMESTAMP_24HOUR_START:
|
case TIMESTAMP_24HOUR_START:
|
||||||
|
|
@ -74,7 +75,8 @@ char *current_time(void)
|
||||||
break;
|
break;
|
||||||
case TIMESTAMP_ISO8601:
|
case TIMESTAMP_ISO8601:
|
||||||
// "YYYY-MM-DDThh:mm:ss.sss" (ISO-8601)
|
// "YYYY-MM-DDThh:mm:ss.sss" (ISO-8601)
|
||||||
tm = localtime(&tv_now.tv_sec);
|
tv = tv_now;
|
||||||
|
tm = localtime(&tv.tv_sec);
|
||||||
len = strftime(time_string, sizeof(time_string), "%Y-%m-%dT%H:%M:%S", tm);
|
len = strftime(time_string, sizeof(time_string), "%Y-%m-%dT%H:%M:%S", tm);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue