摘要: 数组 public void Test1(LuaTable luaObj_Nums) { int idx = 1; using (luaObj_Nums) { forach (int v in m_Nums) { luaObj_Nums.Set(idx, v); } } } 简单table publ 阅读全文
posted @ 2026-03-05 00:02 yanghui01 阅读(1) 评论(0) 推荐(0)
摘要: 遍历数组 public static void Test1(LuaTable luaObj_AllDatas) { int cnt = luaObj_AllDatas.Length; for (int i = 1; i <= cnt; ++i) { luaObj_AllDatas.Get(i, ou 阅读全文
posted @ 2026-03-04 23:54 yanghui01 阅读(2) 评论(0) 推荐(0)
摘要: 新买的笔记本预装了Win11家庭版,不支持远程桌面,左下角还有各种广告,习惯了Win10 Ltsc的干净实在没法忍,决定换成Win11 Ltsc试试 Win11 Ltsc一开始试了Iot版本,因为看到这个版本介绍说是适用于物联网设备,资源占用更低、精简的内容更多,就很心动。 实际用下来不合适,主要原 阅读全文
posted @ 2026-03-01 16:04 yanghui01 阅读(172) 评论(0) 推荐(0)
摘要: 是否为闰年 function TimeUtil.IsLeapYear(year) local b = (year % 4 == 0 and year % 100 ~= 0) or (year % 400 == 0) return b end local m_MonthDaysMap = { 31, 阅读全文
posted @ 2025-08-31 23:15 yanghui01 阅读(30) 评论(0) 推荐(0)
摘要: 美国习惯星期转中国习惯星期function TimeUtil.WdayToWdayCN(wday) if 1 == wday then return 7 else return wday - 1 end end 美国习惯的星期加减, 1_周日, 2_周一 ... 7_周六 function Time 阅读全文
posted @ 2025-08-30 19:06 yanghui01 阅读(19) 评论(0) 推荐(0)
摘要: 一些工具函数 获取本地时区偏差 @return integer 当前时区与UTC时间的偏移秒数 function TimeUtil.GetLocalTimeZoneOffset() local timestamp = os.time() local date = os.date("!*t", tim 阅读全文
posted @ 2025-08-30 15:32 yanghui01 阅读(48) 评论(0) 推荐(0)
摘要: 测试代码 local date1 = { year = 2024, month = 11, day = 3, hour = 1, min = 0, sec = 0 } local timestamp1 = os.time(date1) local date2 = { year = 2024, mon 阅读全文
posted @ 2025-08-30 15:31 yanghui01 阅读(33) 评论(0) 推荐(0)
摘要: 对于美国东部时区(UTC-5) ,如果只有日期时间信息,2024-03-10 02:00:00,我们没法直接判断是否为夏令时,为什么呢?看下面两个时间字符串: 1) 2024-03-10 02:00:00(EST, UTC-5) 是夏令时 2) 2024-03-10 02:00:00(EDT, UT 阅读全文
posted @ 2025-08-30 15:31 yanghui01 阅读(18) 评论(0) 推荐(0)
摘要: isdst参数对os.time的影响 把电脑时区先改为UTC-5时区,这边用美国东部时区(UTC-5)来试验 local function PrintDate(tag, deltaTimestamp, dt) if dt.isdst then print(tag, deltaTimestamp, s 阅读全文
posted @ 2025-08-30 15:31 yanghui01 阅读(83) 评论(0) 推荐(0)
摘要: lua中的数组索引从1开始 --x最小值为1 local function CircularAccess(x) local arr = ["a", "b", "c"] local idx = math.fmod(x, #arr) if 0 == idx then idx = #arr end pri 阅读全文
posted @ 2025-08-30 15:30 yanghui01 阅读(9) 评论(0) 推荐(0)