Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 482

Rainmeter.exe crash with unrecognized format code for Lua os.date()

$
0
0
Rainmeter.exe crash with unrecognized format code for Lua os.date()

Example: os.date('%P')
%P does not exist as an os.date() format code.
Lua - Date and Time format code | https://www.lua.org/pil/22.1.html

I am trying to use some Date and Time format code for the Lua from
C++ time.h format code | https://learn.microsoft.com/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l
Since I could not find the full list of a format code for Lua 5.1.5 os.date().

Minimum code to reproduce the issue.
Skin.ini

Code:

[Variables]$=1.00[Rainmeter]Update=1000[I]Measure=ScriptScriptFile=#@#Scripts\init.luaDisabled=1[Box]Meter=ImageW=(80*#$#)H=(80*#$#)SolidColor=EDEADELeftMouseUpAction=[!CommandMeasure I "test1()"]
@Resources\Scripts\init.lua

Code:

function test1()  --  -- These works.  --  -- print(os.date('%p'))  -- AM/PM  -- print(os.date('%e'))  -- Day of month  --  -- These does not work. It cause rainmeter.exe to crash.  --  print(os.date('%P'))      -- UPPERCASE of p  -- print(os.date('%#m'))  -- `%m` Month [01-12]. trying to remove leading zero.end
Rainmeter 4.5.21.3750 (64-bit)
Language: English (1033)
Build time: 2024-03-01 21:15:52
Windows 10 Pro 22H2 (build 19045.4651) 64-bit - Japanese (1041)
Path: C:\Apps\Rainmeter\
SkinPath: C:\Apps\Rainmeter\Skins\
SettingsPath: C:\Apps\Rainmeter\
IniFile: C:\Apps\Rainmeter\Rainmeter.ini

Removed all Rainmeter\Plugins\*.dll for testing.

Time measure Format Codes | https://docs.rainmeter.net/manual/measures/time/#FormatCodes
Working with date / time in Lua by jsmorley | https://forum.rainmeter.net/viewtopic.php?t=27625
Lua - os.date() | https://www.lua.org/manual/5.1/manual.html#pdf-os.date
Lua - Date and Time format code | https://www.lua.org/pil/22.1.html
C++ time.h format code | https://learn.microsoft.com/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l

Statistics: Posted by nek — 26 minutes ago — Replies 0 — Views 9



Viewing all articles
Browse latest Browse all 482

Trending Articles