Help with getting certain value in variable

I simply want to know how to get the dataTable[“min”] in this variable

local key = "Y:"..dateTable["year"].." M:"..dateTable["month"].." D:"..dateTable["day"].." H:"..dateTable["hour"].." I:"..dateTable["min"]

how would i do that

2 Likes

Dunno what your dateTable is but you can use os.date()

local text = "Y:%Y M:%m D:%d H:%H I:%M"
local key = os.date(text, os.time())

1 Like

I assume you would need to extract it from a string?

key:match('I:(%S+)') would get the number after your I: which I assume is the min value you need.

You can play around with regular expressions here and experiment which patterns would suit you best next.

image