`os.date` format issues
Ocawesome101 opened this issue ยท 8 comments
Minecraft Version
1.19.x
Version
1.100.9
Details
The CC:T Wiki page for os.date
notes that "The format string takes the same formats as C's strftime function." However, while this is mostly true, %l
(and perhaps others) are missing.
%l
is relative to the current timezone; the UTC-only %I
format is present. Curiously, CC:T's implementation of %I
appears to behave like %l
when the date format is not prefixed with a !
.
The 24-hour equivalents %k
and %H
are identically incorrect - %k
is nonexistent while %H
only behaves correctly with !
in the format string.
it appears this is more relevant to the Cobalt repository?
Nah, CC:T has its own implementation.
ok so i've started looking at this and i don't understand what the offset
parameter to LuaDateTime.format
even does - it isn't used except in recursive calls to the same method.
I honestly have no clue either. I probably added thinking it'd be needed, and then failed to remove it.
@Ocawesome101 Did you have an opportunity to look any further at this?
Do you have any documentation for %l
and %k
? They don't appear in the C standard and PUC Lua doesn't support them - are you sure they're not a glibc extension or something?
huh, TIL that PUC Lua supports prefixing with a !
. i don't recall that being in the manual, but then again i haven't looked at that section in great detail.