hardbyte / hardbyte/python-can
When reading a BLF file with python-can, the parsed timestamps are always 8 hours later than what is shown in Vector CANoe.
- Ngôn ngữ chính
- Python
- Star
- 1.6k
- Fork
- 697
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Describe the bug
When reading a BLF file with python-can, the parsed timestamps are always 8 hours later than what is shown in Vector CANoe.
### To Reproduce
1.Create or record a BLF file with CANoe.
2.Open the BLF file in CANoe → check message timestamps (example: 13:00).
3.Open the same BLF file with python-can using the following script:
`import can
import datetime
blf_file = "test.blf"
with can.BLFReader(blf_file) as log:
for msg in log:
t_raw = datetime.datetime.fromtimestamp(msg.timestamp)
print(f"Time: {t_raw}, Relative seconds: {msg.timestamp}")`
4.Observe that the timestamps printed by python-can are +8 hours compared to CANoe (example: 21:00).
### Expected behavior
Timestamps should match those shown in CANoe (e.g., 13:00).
### Additional context
OS and version:Windows 11
Python version: Python 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)] on win32
python-can version:python-can 4.6.1
python-can interface/s (if applicable):
Traceback and logs
```python
def func():
return "hello, world!"
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with the BLFReader entry point and reproduce the timestamp conversion using the script in the issue on a CANoe-created BLF file. Compare the result with CANoe's displayed time and determine the expected timezone or offset behavior; done means the parsed timestamps match CANoe for the reported example.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100