Hi all!

I wanted to save a local at the beginning of a code that would save the exact date and time and then another one at the end. To give an example, I've coded the following:

Code:
pause on
local time1: di %tcDDmonCCYY_HH:MM:SS clock("$S_DATE $S_TIME", "DMYhms")

di "`time1'"

pause: wait a minute

local time2: di %tcDDmonCCYY_HH:MM:SS clock("$S_DATE $S_TIME", "DMYhms")

di "`time2'"

local dif=`time1'-`time2'

di "`dif'"

pause off
When I display the locals it looks like they have the desired format. However, I want to be able to calculate the difference between the two locals and that's when I get the following error:

local dif=`time1'-`time2'
13jun2020 invalid name
r(198);
So I guess the problem is in the format I'm saving the dates in the locals. Do you know how could I do what I want?
Thanks!