Working with nanosecond timestamp strings

I have timestamps with resolution down to nanoseconds. I would like to be able to parse timestamps and create Javascript Date objects (or some extension or equivalent) so that they can be sorted / added / subtracted, etc. But it looks like the Javascript Date object doesn't go beyond milliseconds.

Is there a way to extend a Date object to store additional precision? I've searched for existing libraries that do this but haven't found it yet.

To be clear, I don't need to get nanoseconds from Date.now () ... I just need to be able to parse timestamp strings in objects that have the precision I need.

JS environment is a browser (not Node.js).

+3


source to share





All Articles