设为首页收藏本站喵玉殿官方微博

 找回密码
 少女注册中
搜索
查看: 1981|回复: 4

[编程算法] 【转载】(已获得原作者许可)阿求趋势倒计时

[复制链接]
发表于 2023-8-1 06:27:55 | 显示全部楼层 |阅读模式
本帖最后由 FOXY_FOX 于 2023-8-1 07:53 编辑

原作者地址
【便宜创作】只有681字节的稗田阿求趋势倒计时【东方吧】_百度贴吧
https://tieba.baidu.com/p/8529246171?pn=1

97e9c2cec3fdfc03df0b0c88923f8794a4c226a0.jpg 这个是效果图

代码如下(1代)
Function UnixTime()
Set objWMIService = _
GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
TimeZone = objItem.CurrentTimeZone
Next
UnixTime = DateDiff("s", "01/01/1970 00:00:00", Now())
UnixTime = UnixTime - TimeZone * 60
End Function
timerest = 1722956400-unixtime
x1=timerest\86400
timerest2=timerest-x1*86400
x2=timerest2\3600
timerest3=timerest2-x2*3600
x3=timerest3\60
x4=timerest3-x3*60
msgbox "现在是" & date & " " & time & chr(13)+ chr(10) & "距离稗田阿求趋势还有" & x1 & "天" & x2 & "小时" & x3 & "分" & x4 & "秒", 48 , "稗田阿求趋势倒计时"
将以上内容输入txt文件保存,后缀名改为VBS即可

部分电脑可能出现无故报错的情况(其实是无故报错还是真的不兼容我也不知道)
bfeb9825bc315c60286684dfcbb1cb1349547720.jpg (大概是这个样子)
解决办法一:
将编码改为ANSI

图一针对Notepad++
5553f31fbe096b633204b6604a338744ebf8acf3.jpg


图二针对记事本
4559500fd9f9d72aad79f82d922a2834349bbbf3.jpg

解决方法二
换用代码:稗田阿求趋势倒计时2.0(阿求:这种东西不要再更新了啊!!!)
Function UnixTime()
Set objWMIService = _
GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
TimeZone = objItem.CurrentTimeZone
Next
UnixTime = DateDiff("s", "01/01/1970 00:00:00", Now())
UnixTime = UnixTime - TimeZone * 60
End Function
timerest = 1722956400-unixtime
x1=timerest\86400
timerest2=timerest-x1*86400
x2=timerest2\3600
timerest3=timerest2-x2*3600
x3=timerest3\60
x4=timerest3-x3*60
limited = unixtime - 1576800000
rebirth = 3299756400 - unixtime
y0=rebirth\31536000
yoll=y0+50
rebirth0=rebirth-31536000*y0
y1=rebirth0\86400
rebirth1=rebirth0-86400*y1
y2=rebirth1\3600
rebirth2=rebirth1-3600*y2
y3=rebirth2\60
y4=rebirth2-60*y3
if unixtime < 1722956401 then
msgbox "现在是" & date & " " & time & chr(13)+ chr(10) & "距离稗田阿求趋势还有" & x1 & "天" & x2 & "小时" & x3 & "分" & x4 & "秒", 48 , "稗田阿求趋势倒计时"
else
msgbox "现在是" & date & " " & time & chr(13)+ chr(10) & "距离第十代御阿礼之子诞生还有" & yoll & "年" & y1 & "天" & y2 & "小时" & y3 & "分" & y4 & "秒", 64 , "第十代御阿礼之子诞生倒计时"
end if


再放一次原作者地址
【便宜创作】只有681字节的稗田阿求趋势倒计时【东方吧】_百度贴吧
https://tieba.baidu.com/p/8529246171?pn=1

发表于 2023-8-12 20:05:14 | 显示全部楼层
不到一年了(

点评

許是東方眾等待[?]已久的時刻, 大抵在那後會有奇怪的外號誕生罷  发表于 2023-8-12 20:31
回复

使用道具 举报

发表于 2023-8-12 20:10:28 | 显示全部楼层
本帖最后由 苍天的园艺师 于 2023-8-12 20:12 编辑

我在主页放了一个倒计时,因为模块放代码跑不了我就上图手动改了,目前还有360天
具体是:

360天3时47分56秒
回复

使用道具 举报

发表于 2023-8-12 20:17:19 | 显示全部楼层
而距离 阿X十世诞生还有:


--Y--M--D  --h--m--s----ms

希腊奶
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 少女注册中

本版积分规则

合作与事务联系|无图版|手机版|小黑屋|喵玉殿

GMT+8, 2025-10-31 22:03

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表