Skip to content

Commit b3bbe00

Browse files
committed
Issue #118: Fix DefaultFormatters, milliseconds in nodejs drop a 0 at the end. Make sure to make them 3 long always.
1 parent 315dbdf commit b3bbe00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/typescript/main/core/impl/DefaultFormatters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import {padStart} from "../../util/StringUtil";
12
import {ArgumentFormatterType} from "../api/type/ArgumentFormatterType";
23
import {DateFormatterType} from "../api/type/DateFormatterType";
3-
import {padStart} from "../../util/StringUtil";
44

55
/**
66
* Default argument formatter function, used by the library, see {@link ArgumentFormatterType}.
@@ -29,6 +29,6 @@ export function formatDate(millisSinceEpoch: number): string {
2929
const hours = padStart(date.getHours().toString(), 2, "0");
3030
const minutes = padStart(date.getMinutes().toString(), 2, "0");
3131
const seconds = padStart(date.getSeconds().toString(), 2, "0");
32-
const millis = padStart(date.getMilliseconds().toString(), 2, "0");
32+
const millis = padStart(date.getMilliseconds().toString(), 3, "0");
3333
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds},${millis}`;
3434
}

0 commit comments

Comments
 (0)