跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
社群首页
帮助
希顶相关网站
希顶社区官网
(原作)希顶翻译器
〇改希顶转写器
希顶模组服务器
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁Module:Time”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
←
Module:Time
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、storagereadable
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local module = {} local getArgs = require('Module:Arguments').getArgs function module.test() local now=os.time() local start=os.time({year=2021,month=9,day=1,hour=3}) local days=(now-start)/86400 local dayint=math.floor(days) local hours=((now-start)%86400)/3600 return dayint..'天'..hours..'小时' end function module.directly() return os.date('%p')..' '..os.date('%c') end function sunColor(inp) local rainbow = {"#f4592d", "#eda667", "#faf03e", "#5fb319", "#8eede2", "#0568e3","#49207c"} local l = inp % 7 local u = math.floor(inp/7+0.125) % 7 return '<span style="background:-webkit-linear-gradient(90deg, '..rainbow[7-l]..' 0%, '..rainbow[7-l]..' 50%, '..rainbow[7-u]..' 50%, '..rainbow[7-u]..' 100%)"> </span>' end function sun49(inp) local gua = {"火", "祭祀", "对手", "成败", "反叛", "救赎", "爆发", "欲望", "木", "创造", "新生", "凋谢", "重生", "弥散", "自我", "寻找", "存在", "经典", "革新", "梦幻", "倾听", "忍耐", "腐朽", "绝笔", "地", "孤独", "小人", "永恒", "恶魔", "盛开", "理解", "泥土", "风", "雾气", "神", "对抗", "绽放", "思考", "同伴", "变幻", "水", "隐退", "超越", "生命", "表达", "破碎", "时间", "朦胧", "自然"} return gua[49-(inp%49)] end function module.nowSunDay(frame) local args = getArgs(frame) local display = args[1] local color = string.lower(tostring(args[2])) local offset = args[3] if (offset == nil) then offset = 0 else offset = tonumber(offset) end local now = os.time() + offset * 86400 local start = os.time({year=1996,month=1,day=28,hour=0}) local days = (now-start) / 86400 local dayint = math.floor(days) local dayfroms = dayint + 1706817 local phase = (-dayfroms) % (49*49*49*49) local d = phase % 49 local s = math.floor(phase/(49)+0.125) % 49 local t = math.floor(phase/(49*49)+0.125) % 49 local p = math.floor(phase/(49*49*49)+0.125) local dc = "" local sc = "" local tc = "" local pc = "" if (color == "true") then dc = sunColor(d) sc = sunColor(s) tc = sunColor(t) pc = sunColor(p) end if (display=='1') then return dc..sun49(d).."日" else if (display=='2') then return sc..sun49(s).."季 "..dc..sun49(d).."日" else if (display=='3') then return tc..sun49(t).."轮 "..sc..sun49(s).."季 "..dc..sun49(d).."日" else return pc..sun49(p).."朝 "..tc..sun49(t).."轮 "..sc..sun49(s).."季 "..dc..sun49(d).."日" end end end end return module
该页面使用的模板:
Module:Time/doc
(
查看源代码
)
返回
Module:Time
。