I am making a gui that gets the product information, and I want the Asset.Created
property to be displayed in this format: YYYY-MM-DD but have had no luck doing so. I want the localscript to find a resemblance to the previous format, and then make it into a string, but the problem is that each asset always has a different date it was created. Is there any way of doing this?
The timestamp is ISO formatted. You can create a new DateTime object from the timestamp and get the date from the object in different formats using “Composite Tokens”.
local timestamp = "2018-08-01T17:55:11.98Z"
local dateTime = DateTime.fromIsoDate(timestamp)
print(dateTime:FormatLocalTime("ll", "en-us"))
--> Aug 1, 2018
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.