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

formatISO does not support milliseconds #2968

Open
fregante opened this issue Feb 20, 2022 · 6 comments
Open

formatISO does not support milliseconds #2968

fregante opened this issue Feb 20, 2022 · 6 comments

Comments

@fregante
Copy link

I'm looking to use formatISO to preserve the time zone, but it does not match the ISO used by JavaScript itself and there doesn't seem to be an option to enable it:

const date = new Date();

console.log(date.toISOString())
// "2022-02-20T04:00:45.418Z"

console.log(_.formatISO(date))
// "2022-02-20T12:00:45+08:00" <-- missing 418 milliseconds
@mandaputtra
Copy link
Member

I think this is same as #2965

@fregante
Copy link
Author

This is not a documentation issue. That issue does not mention milliseconds at all

@mandaputtra
Copy link
Member

mandaputtra commented Feb 27, 2022

Yes from the title, but this sentence are basically the same.

Executing that very code in the console comes back with '19:00:52-07:00' and not '19:00:52Z'.

I'm still looking up into this problem

@fregante
Copy link
Author

fregante commented Feb 27, 2022

Can you reopen this issue while you investigate? Regardless of what it "looks like" this is a feature request / inconsistency report. The only thing in common with #2965 is the affected function.

Cc @kossnocorp

@mandaputtra mandaputtra reopened this Feb 27, 2022
@fregante
Copy link
Author

Terima kasih mas 🙏

@mandaputtra
Copy link
Member

I'm wrong, after looking up, turns out milliseconds aren't implemented yet. Sorry. Please review my draft if it is okay or not.

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

No branches or pull requests

2 participants