asammdf
asammdf copied to clipboard
The time of x x-axis is advace 8hour compare china
Dear:
- when I Concatenate dat, the dat tims is advace 8hour compare in china.
- For example: The real date of dat is 13:41:12 , But after Concatenate using Asammdf tool the date will become 05:43:12.
- So I think it is time zone is different between your location and china, do you think so? or what is root cause do you think.
4: is it possible to change it to correct date after concatenatigng dat?
Thanks very much.
I check the code. it seem here(the following figure) need to be change. But at this moment, I do not konw how to modify it.

C:\A_miniConda_py37\Lib\site-packages\asammdf\blocks\v2_v3_blocks.py (1 hit)
Line 2568: * tz_offset - int : UTC time offset in hours (= GMT time zone)
C:\A_miniConda_py37\Lib\site-packages\asammdf\blocks\v4_blocks.py (2 hits)
Line 4672: * tz_offset - int : UTC time offset in hours (= GMT time zone)
Line 4800: * tz_offset - int : UTC time offset in hours (= GMT time zone)
C:\A_miniConda_py37\Lib\site-packages\asammdf\blocks_pycache_\v2_v3_blocks.cpython-37.pyc (1 hit)
Line 967: * tz_offset - int : UTC time offset in hours (= GMT time zone)
C:\A_miniConda_py37\Lib\site-packages\asammdf\blocks_pycache_\v4_blocks.cpython-37.pyc (2 hits)
Line 1430: * tz_offset - int : UTC time offset in hours (= GMT time zone)
Line 1489: * tz_offset - int : UTC time offset in hours (= GMT time zone)
C:\A_miniConda_py37\Lib\site-packages\asammdf\gui\widgets\file.py (1 hit)
Line 433: 1, self.mdf.header.start_time.strftime("%d-%b-%Y %H:%M:%S + %fus UTC")
C:\A_miniConda_py37\Lib\site-packages\asammdf\gui\widgets\tabular.py (2 hits)
Line 208: ts = ts.tz_convert("UTC").to_datetime64()
Line 306: index = df.index.tz_localize("UTC").tz_convert(LOCAL_TIMEZONE)
C:\A_miniConda_py37\Lib\site-packages\asammdf\gui\widgets_pycache_\file.cpython-37.pyc (1 hit)
Line 43:
C:\A_miniConda_py37\Lib\site-packages\asammdf\gui\widgets_pycache_\tabular.cpython-37.pyc (1 hit)
Line 73:
I try to fix it, Unlucky, I did not fix it. if you want my data. please let me konw, I will share with you to reappear the issue.
Hello, in the first plot the time stamps are extracted using the asammdf package?
Hello I use the asammdf plot is OK the time is OK. But I use other tool to open data is NOK. So I guess the time in data is UTC, when open by asammdf plot the time is transfer local time. But when use other tool, the time do not tranfter. Right? is it possible transfer timestramp to local time when Concatenate several dats? it is also very helpful.
can you share the snippet that you use to generate the new file?
Hi As the following script show.
import datetime from asammdf import MDF as zb_import import os from asammdf import Signal,MDF import numpy as np import glob
Paht_dat_folder = r"L:\009_P*.dat*" Paht_dat_name =glob.glob(Paht_dat_folder)
Paht_dat_name_target = r"L:\009_P\A01_02_03_BST.mf4"
merge_mdf=MDF.concatenate(Paht_dat_name, version='4.10', sync=True, add_samples_origin=True) merge_mdf.save(Paht_dat_name_target,compression=2, overwrite=True)
What is the output of this snippet?
Paht_dat_folder = r"L:\009_P*.dat*"
Paht_dat_name =glob.glob(Paht_dat_folder)
for pth in Paht_dat_name:
print(MDF(pth).start_time)
pin @zhoubo-lab
@zhoubo-lab can you check with the latest development branch?
re-open if necessary
@zhoubo-lab the development branch code might have a fix for your problem. Please check