|
From: theozh <th...@gm...> - 2020-04-03 16:25:46
|
a suggestion for a possible workaround (still to be optimized for all possible cases):
### handling negative times
$Data <<EOD
1 00:01:00
2 -00:01:00
EOD
myTimeFmt = "%tH:%tM:%tS"
myTimeSigned(fmt,s) = s[1:1] eq '-' && strptime("%tH",s)==0 && strptime(fmt,s)>0 ? \
-strptime(fmt,s[2:]) : strptime(fmt,s)
myTime(n,fmt) = myTimeSigned(fmt,strcol(n))
set table $Test
plot $Data u 1:(myTime(2,myTimeFmt)) w table
unset table
print $Test
### end of code
Result:
1 60
2 -60
see more details: https://stackoverflow.com/a/61005915/7295599
Theo.
|