8000 fix for #315 - Include milliseconds in format ISO8601_WITH_TZ_OFFSET · mKoder/log4js-node@9eb0f9d · GitHub
[go: up one dir, main page]

Skip to content

Commit 9eb0f9d

Browse files
committed
fix for log4js-node#315 - Include milliseconds in format ISO8601_WITH_TZ_OFFSET
1 parent 7368cd3 commit 9eb0f9d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/date_format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
exports.ISO8601_FORMAT = "yyyy-MM-dd hh:mm:ss.SSS";
3-
exports.ISO8601_WITH_TZ_OFFSET_FORMAT = "yyyy-MM-ddThh:mm:ssO";
3+
exports.ISO8601_WITH_TZ_OFFSET_FORMAT = "yyyy-MM-ddThh:mm:ss.SSSO";
44
exports.DATETIME_FORMAT = "dd MM yyyy hh:mm:ss.SSS";
55
exports.ABSOLUTETIME_FORMAT = "hh:mm:ss.SSS";
66

test/vows/date_format-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ vows.describe('date_format').addBatch({
2828
date.getTimezoneOffset = function() { return -660; };
2929
assert.equal(
3030
dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, date),
31-
"2010-01-11T14:31:30+1100"
31+
"2010-01-11T14:31:30.005+1100"
3232
);
3333
date = createFixedDate();
3434
date.setMinutes(date.getMinutes() - date.getTimezoneOffset() + 120);
3535
date.getTimezoneOffset = function() { return 120; };
3636
assert.equal(
3737
dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, date),
38-
"2010-01-11T14:31:30-0200"
38+
"2010-01-11T14:31:30.005-0200"
3939
);
4040

4141
},

test/vows/layouts-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ vows.describe('log4js layouts').addBatch({
252252
test(args, '%d', '2010-12-05 14:18:30.045');
253253
},
254254
'%d should allow for format specification': function(args) {
255-
test(args, '%d{ISO8601_WITH_TZ_OFFSET}', '2010-12-05T14:18:30-0000');
255+
test(args, '%d{ISO8601_WITH_TZ_OFFSET}', '2010-12-05T14:18:30.045-0000');
256256
test(args, '%d{ISO8601}', '2010-12-05 14:18:30.045');
257257
test(args, '%d{ABSOLUTE}', '14:18:30.045');
258258
test(args, '%d{DATE}', '05 12 2010 14:18:30.045');

0 commit comments

Comments
 (0)
0