lua获取系统时间 lua脚本如何对比时间?

lua脚本如何对比时间?参考方法如下:local STR1=“12:36:28”local STR2=“14:38:45”local H1,M1,S1=字符串。匹配(str1,“(%d):(%d):(

lua脚本如何对比时间?

参考方法如下:local STR1=“12:36:28”local STR2=“14:38:45”local H1,M1,S1=字符串。匹配(str1,“(%d):(%d):(%d)”)本地h2,m2,s2=字符串。匹配(STR2,“(%d):(%d):(%d)”)本地时间1=H1*3600 M1*60 S1本地时间2=H2*3600 M2*60 S2打印(time2-time1)距离3600有多少小时