当前位置:网站首页>Lua determines whether the current time is the time of the day

Lua determines whether the current time is the time of the day

2022-07-05 04:56:00 Meteor spot

function  isToday(timestamp)
    local today = os.date("*t")
    local secondOfToday = os.time({day=today.day, month=today.month,year=today.year, hour=0, minute=0, second=0})
    if timestamp >= secondOfToday and timestamp < secondOfToday + 24 * 60 * 60 then
        return true
    else
        return false
    end
end

原网站

版权声明
本文为[Meteor spot]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140625238184.html