获取本地时区
local curTimeZoneSec = os.difftime(os.time(), os.time(os.date("!*t", os.time())))


curTimeZoneSec就是距离格林威治时间的偏移量,计算出小时数和分钟数就是本地的时区的显示格式了

os.date('!*t',os.time()) 获取的为格林威治时间


首页 我的博客
粤ICP备17103704号