Also hh:mm:ss is importable as time stamp from xas

This commit is contained in:
halvorhv 2022-09-01 14:08:26 +02:00
parent 8c3861c984
commit 8714e86753

View file

@ -367,7 +367,12 @@ def read_metadata(data: dict, options={}) -> dict:
if options['get_timestamp']: if options['get_timestamp']:
with open(filename, 'r') as f: with open(filename, 'r') as f:
time = f.readline().strip('# Time: ') #time = f.readline().strip('# Time: ') #<-- Previous code
time = f.readline().split('# Time: ')[-1] #Hope this does not fuck you up, Rasmus - but I needed another space here
split_operator=time[-9] #This should be the operator that splits hours, minutes and seconds
if split_operator == ".":
time = datetime.datetime.strptime(time, "%a %b %d %H.%M.%S %Y ")
if split_operator == ":":
time = datetime.datetime.strptime(time, "%a %b %d %H:%M:%S %Y ") time = datetime.datetime.strptime(time, "%a %b %d %H:%M:%S %Y ")
if options['adjust_time']: if options['adjust_time']: