diff --git a/lightweight_charts/abstract.py b/lightweight_charts/abstract.py index fdec43d..87d2f21 100644 --- a/lightweight_charts/abstract.py +++ b/lightweight_charts/abstract.py @@ -202,7 +202,7 @@ class SeriesCommon(Pane): self._set_interval(df) if not pd.api.types.is_datetime64_any_dtype(df['time']): df['time'] = pd.to_datetime(df['time']) - df['time'] = (df['time'].astype('int64') / 10 ** 6).astype(float) + df['time'] = (df['time'].astype('int64') / 10 ** 9).astype(float) # if 'updated' in df.columns: # df['updated'] = pd.to_datetime(df['updated']).astype('int64') / 10**9 @@ -213,7 +213,7 @@ class SeriesCommon(Pane): if col == 'time' or not pd.api.types.is_datetime64_any_dtype(df[col]): continue # Convert datetime to timestamp with nanosecond precision after the decimal - df[col] = (pd.to_datetime(df[col]).astype('int64') / 10**6).astype(float) + df[col] = (pd.to_datetime(df[col]).astype('int64') / 10**9).astype(float) return df diff --git a/setup.py b/setup.py index 1c8f02a..ac029e9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f: setup( name='lightweight_charts', - version='2.1.5', + version='2.1.6', packages=find_packages(), python_requires='>=3.8', install_requires=[