You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ltg:addSignalTag(epoch, r, g, b, a, "name", "tooltip") -- point event, color is linear [0:1]
104
104
```
105
105
106
-
Time conversion (ISO-like "YYYY-MM-DD HH:MM:SS,MS" or "YYYY-MM-DD HH:MM:SS.MS", hour offset as 2nd arg):
106
+
Time conversion. Default pattern is `"yyyy-MM-dd HH:mm:ss,SSS"` (Joda-style). Pass a custom pattern as the 3rd argument to parse / format other layouts. Supported tokens: `yyyy`/`yy` (year), `MM` (month), `dd` (day), `HH`/`hh` (hour 24/12), `mm` (minute), `ss` (second), and a trailing `S` run (N digits, fractional seconds — must be at the end of the pattern, preceded by exactly one delimiter character):
Copy file name to clipboardExpand all lines: plugins/LuaScripting/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,13 @@ Each call goes through the host's Messaging singleton and shows up in the Consol
47
47
48
48
### Date / time conversion
49
49
50
-
ISO-like strings (`"YYYY-MM-DD HH:MM:SS,MS"` or `"YYYY-MM-DD HH:MM:SS.MS"`), with an hour offset as the second argument:
50
+
Default Joda-style pattern `"yyyy-MM-dd HH:mm:ss,SSS"`. An optional 3rd argument overrides the pattern. Supported tokens: `yyyy`/`yy` (year), `MM` (month), `dd` (day), `HH`/`hh` (hour 24/12), `mm` (minute), `ss` (second). A trailing run of `S` marks fractional seconds (N digits, must be at the end of the pattern, preceded by exactly one delimiter character). Hour offset is the 2nd argument:
51
51
52
52
```lua
53
-
localepoch=ltg:stringToEpoch("2023-01-16 15:24:26,464", 0) -- -> double (epoch seconds, ms preserved)
locals2=ltg:epochToString(e2, 0, "yyyy-MM-dd HH:mm:ss") -- no fractional part
55
57
```
56
58
57
59
Both throw a `std::runtime_error` on a bad format. With the auto-bp-on-error toggle on, that throw pauses the worker at the exact line of the call, with the actual boost message visible.
0 commit comments