alpaca-trade-api-js icon indicating copy to clipboard operation
alpaca-trade-api-js copied to clipboard

[Bug]: Date precision

Open germanamz opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

The implementation of the data stream casts timestamps with nanosecond precision to javascript Date object which has millisecond precision, this causes data loss.

Expected Behavior

Have the original datetime string with nanosecond precision.

SDK Version I encountered this issue in

alpaca-trade-api version: 3.0.1

Steps To Reproduce

1. Subscribe to any symbol using the data stream listener.
2. Get any trade event

Filled out the Steps to Reproduce section?

  • [X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

Anything else?

No response

germanamz avatar Nov 08 '23 15:11 germanamz