Question

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'

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top