문제

table.concat(os.date("*t"), ":",4,6)

any idea why ^this^ or ˇthisˇ

test = os.date("*t")
table.concat(test, ":" , 4 , 6 )

does not work?

input:3: invalid value (nil) at index 4 in table for 'concat'

도움이 되었습니까?

해결책

table.concat works on numerically indexed table. Whereas the output of os.date '*t' would be a table like:

hour    18
min 20
wday    1
day 2
month   3
year    2014
sec 49
yday    61
isdst   false

다른 팁

Although not the answer to your direct question, I suspect you are trying to do is retrieve the time separated by colons.

The best way to do that is os.date"%H:%M:%S"

The formatting options are very flexible and use the C strftime format.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top