For example, I have this date right here. (2009-02-24T15:37:37.58Z) and I want to remove specific elements to just display the year, month and day. So it would look like this. (2009-02-24)
How can I archieve something like this using Lua?
Generally, you can use gsub which can replace a pattern in the string with a desired character(s), which we can use empty strings for to remove specific elements. In this case, we can just search for a substring matching a "T" and everything else that follows it and replace it with an empty string. In layman's terms, it will remove the character "T" and everything else that follows it so you're just left with the date.
timestamp = timestamp:gsub("T.*", "")