生成随机时间 日期加减 Autohotkey

本文来自于Thinkai’s Blog,thinkai也是我在ahk上面的引路人,对thinkai感兴趣的朋友请关注他的博客。
thinkai的博客简洁、有趣,即便是转载过来我也尽量保持作者原有的风格,主要是方便大家查阅。
MsgBox % GenTime()
 
 
;生成随机时间 前1小时-前三天内
GenTime(){
    FormatTime, outdate, % Time_unix2human(Time_human2unix(A_Now)+rand(28800,35000)), yyyy-MM-dd HH:mm:ss
    return outdate
}
 
 
rand(min,max){ ;随机函数
    Random, out, % min, max
    return out
}
 
;unix时间戳转换函数
Time_unix2human(time)
{
        human=19700101000000
        time-=((A_NowUTC-A_Now)//10000)*3600        ;时差
        human+=%time%,Seconds
        return human
        }
Time_human2unix(time)
{
        time-=19700101000000,Seconds
        time+=((A_NowUTC-A_Now)//10000)*3600        ;时差
        return time
}



给TA捐赠
共{{data.count}}人
人已捐赠
其他教程

获取生成32位UUID GUID Autohotkey

2020-2-18 9:34:39

其他教程

图灵机器人文字聊天Demo Autohotkey

2020-2-18 9:37:51

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
有新私信 私信列表
搜索