question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

formatISO does not support milliseconds

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mandaputtracommented, Feb 27, 2022

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

1reaction
fregantecommented, Feb 27, 2022

Terima kasih mas 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISO 8601 with milliseconds and Retrofit - java
Java Date has millisecond precision so I've been creating the Gson object like so: Gson gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.
Read more >
luxon 3.1.1 | Documentation
A DateTime is an immutable data structure representing a specific date and ... Each DateTime instance refers to a specific millisecond of the...
Read more >
How to parse JSON date format ISO 8601 to string with ...
I have tried to parse it as seen below. But I can't figure out how to get the same milliseconds like in the...
Read more >
Date.prototype.toISOString() - JavaScript - MDN Web Docs
The toISOString() method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.
Read more >
Using Datetime in Painless
Subtract three seconds from a numeric datetime in milliseconds ... Under most Painless contexts the current datetime, now , is not supported.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found