FOXY_FOX 发表于 2023-8-1 06:27:55

【转载】(已获得原作者许可)阿求趋势倒计时

本帖最后由 FOXY_FOX 于 2023-8-1 07:53 编辑

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

这个是效果图
https://bbs.nyasama.com/forum.php?mod=image&aid=179150&size=300x300&key=6836f98ba590ce1a&nocache=yes&type=fixnone
代码如下(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即可

部分电脑可能出现无故报错的情况(其实是无故报错还是真的不兼容我也不知道)
(大概是这个样子)
解决办法一:
将编码改为ANSI
https://bbs.nyasama.com/forum.php?mod=image&aid=179152&size=300x300&key=acab1db7b3ecd430&nocache=yes&type=fixnone
图一针对Notepad++


https://bbs.nyasama.com/forum.php?mod=image&aid=179153&size=300x300&key=9dd4557539a998c6&nocache=yes&type=fixnone
图二针对记事本


解决方法二
换用代码:稗田阿求趋势倒计时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

灯火_Lantern 发表于 2023-8-12 20:05:14

不到一年了(

苍天的园艺师 发表于 2023-8-12 20:10:28

本帖最后由 苍天的园艺师 于 2023-8-12 20:12 编辑

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

360天3时47分56秒

苍天的园艺师 发表于 2023-8-12 20:17:19

{:12:}而距离 阿X十世诞生还有:


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

希腊奶
页: [1]
查看完整版本: 【转载】(已获得原作者许可)阿求趋势倒计时