Also hh:mm:ss is importable as time stamp from xas
This commit is contained in:
parent
8c3861c984
commit
8714e86753
1 changed files with 7 additions and 2 deletions
|
|
@ -367,7 +367,12 @@ def read_metadata(data: dict, options={}) -> dict:
|
|||
if options['get_timestamp']:
|
||||
|
||||
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 ")
|
||||
|
||||
if options['adjust_time']:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue