The usual Lua way is with this function, available as global time() in WoW, and passing it a table with the named fields.
Those tables can be built by you, or by the date() function. If you're starting with a time_t then you can keep the table around and then create formatted strings from there; if you're starting with a formatted string from somebody else, then you'll need to use something like
local year, month, day, hour, minute, second = that_date_string:match"(%d+)-(%d+)-(%d+) (%d+):(%d+):(%d+)"
and then assign the table fields yourself. The string matching pattern should probably be more robust than the one I drycoded above.