Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes timezone format #27

Merged
merged 3 commits into from Jan 10, 2022
Merged

Fixes timezone format #27

merged 3 commits into from Jan 10, 2022

Conversation

lamweili
Copy link
Collaborator

@lamweili lamweili commented Jan 6, 2022

Fixes #24

const format = require('date-format')

// parse from date to string (always return timezone with colon)
format(format.ISO8601_WITH_TZ_OFFSET_FORMAT, new Date());
// 2017-03-14T14:10:20.391+11:00

// parse to date, timezone without colon (backward compatibility)
let date1 = format.parse(format.ISO8601_WITH_TZ_OFFSET_FORMAT, '2017-03-14T14:10:20.391+1100');
// 2017-03-14T03:10:20.391Z

// parse to date, timezone with colon
let date2 = format.parse(format.ISO8601_WITH_TZ_OFFSET_FORMAT, '2017-03-14T14:10:20.391+11:00');
// 2017-03-14T03:10:20.391Z

@nomiddlename
Copy link
Owner

I would have thought that this would break a few existing tests?

@lamweili lamweili added this to the 4.0.0 milestone Jan 10, 2022
@lamweili
Copy link
Collaborator Author

You are right, I have corrected and pushed in those tests.

@lamweili lamweili merged commit 6319fa5 into nomiddlename:master Jan 10, 2022
@lamweili lamweili mentioned this pull request Jan 14, 2022
@thernstig
Copy link

@peteriman Include this in a new log4js update :)?

@lamweili
Copy link
Collaborator Author

@thernstig Yes, it will be in the upcoming log4js update, either 6.4.0 or 7.0.0.
Most likely 7.0.0 instead as the addition colon in timezone might be a breaking change for some.

I have merged it: log4js-node/log4js-node#1134

@lamweili
Copy link
Collaborator Author

@thernstig It is released in log4js@6.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Colon in timezone
3 participants